title: Use Windows authentication as login credentials for intranet applications
body: <p>I'm working on an intranet web application in PHP. Im trying to use Windows NT login credentials to logon to the application. The trouble im having here is how do i get the remote users windows username?
  I want to obtain the username and then check against various LDAP groups so that I can direct them to appropriate pages in my application.</p>
  
  <p>I've so far tried </p>
  
  <pre><code>&lt;?php
  echo $_SERVER['REMOTE_USER'];
  echo $_SERVER['PHP_AUTH_USER'];
  ?&gt;
  </code></pre>
  
  <p>Both of them return empty values.</p>
  
  <p>UPDATE: Using $_SERVER['REMOTE_ADDR'] Im able to get the IP address of the computer. Is there anyway I could get userid/username (anything unique) and use it to compare against LDAP groups? I would want to do this, when they enter the main page of the website and store a session and then use the session variable throughout the website.</p>