Jump to content

Capture Windows Username from login panel


codeventure

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

Mike
Link to comment
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.....

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