codeventure Posted June 26, 2006 Share Posted June 26, 2006 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....Mike Quote Link to comment Share on other sites More sharing options...
codeventure Posted June 27, 2006 Author Share Posted June 27, 2006 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.....<html><head><title>Test</title></head><body><?php $username = str_replace("DOMAIN\\\\", "", $_SERVER['REMOTE_USER']); ?>Hello <?php printf("$username"); ?>, and welcome! <br><br> </body></html> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.