Jump to content


Capture Windows Username from login panel

  • Please log in to reply
1 reply to this topic

#1 codeventure

  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 26 June 2006 - 09:00 PM

Hi All,

Does anyone know if you can use PHP to capture the Windows username from Windows logon prompt that appears when our intranet site visitors try to access parts of the site that are not using annonymous access ? I would like to be able to capture the username, and use it for logging and redirection according to who the user is. We are using Windows 2000 Server and IIS, and have some parts of our web stie that require a windows domain username and password to access, so the windows authentication prompt appears when certain hyperlinks are clicked on..That is where we would like to capture the username if possible. The password is not needed. Thanks in advance....


#2 codeventure

  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 27 June 2006 - 02:43 PM

Thanks for looking fellas. It looks like $_SERVER['REMOTE_USER'] is probably what I am looking for. I found this snippet on the internet this morning and it seems to do what I am looking for.....

<?php $username = str_replace("DOMAIN\\\\", "", $_SERVER['REMOTE_USER']); ?>
Hello <?php printf("$username"); ?>, and welcome!


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users