Jump to content

Windows Username Please Help


sergeyba

Recommended Posts

Hello to all.

i am using apache,mysql and php on windows XP and soon wil move to windows server 2003, need something that will work on both.

i need some kind of script that will get me the current clients windows username.

 

i dont really care what language it will be written. all i need is that it will be possible to embbed it into php page without any extra modules if possible, if not then with some kind of module that is free.

(how to embbed it as well will be more than welcome)

 

thank you very much all. please i need it as fast as i can.

Link to comment
https://forums.phpfreaks.com/topic/64542-windows-username-please-help/
Share on other sites

I haven't tried this with Apache, only on a windows network with IIS, but

 

$domainUser = $_SERVER['LOGON_USER'];                   //--> domain\username or  domain\\username (version?)
list ($domain,$username) = explode ('\\', $domainUser); // or explode ('\\\\', $domainUser);
echo $username;

 

For this to work with IIS, the folder containing the script must not allow anonymous access.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.