I got it to work using this code:
$NTusername = $_SERVER['AUTH_USER'];
$NTpassword = $_SERVER['AUTH_PASSWORD'];
if ($NTusername == "") {
$NTusername = $_SERVER['PHP_AUTH_USER'];
$NTpassword = $_SERVER['PHP_AUTH_PW'];
}
$userdn = $domain."\\".$NTusername;
$userpass = $NTpassword;
$ds = ldap_connect("ldap://your.domain.com");
$bind = ldap_bind($ds, $userdn, $userpass) OR DIE("bind failed");
This may only work with IIS though. IIS has to be configured to use "Basic Authentication" but NOT "Integrated Windows Authentication"
When the site is first accessed, it pops up a little dialog asking for the username and password.
The _SERVER variables may work without IIS, I wouldn't know.
John