Jump to content


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


Capture Windows Username from login panel

Recommended Posts

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


Share this post

Link to post
Share on other sites
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!


Share this post

Link to post
Share on other sites


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.