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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.