Click here to Skip to main content
15,893,266 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi Guys,

Is it possible to get the NT username using php? Im creating a php page that runs internally using apache server but i need to get the nt username name of the visitor. So far i have this code
PHP
<?php
	// get client username
	echo 'My username is: ' . $_SERVER['LOGON_USER'];
?>
but nothing shows. Thanks
Posted

1 solution

 
Share this answer
 
v2
Comments
athan_makubex 30-Jul-13 16:25pm    
Hi Maciej,
I tried the code on the link but it displays the home folder where the server is installed. I want the username of the client visit the page. Thanks
Maciej Los 30-Jul-13 16:36pm    
See my answer, now ;)
athan_makubex 30-Jul-13 16:53pm    
Hi Maciej,

I tried the code and it's working now. Thank you so much!
Maciej Los 30-Jul-13 16:56pm    
You're welcome ;)
Maddy_jadav 4-Feb-19 2:50am    
Hi Maciej,

Greetings!!

I am looking for the similiar code to fetch the client username, Could you please provide the same to me.

Regards,
Madan

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900