If you’re using IIS in conjunction with PHP’s ISAPI module, and you want to use PHP’s HTTP authentication
capabilities, you need to make a minor modification to the examples offered throughout this chapter. The username
and password variables are still available to PHP when using IIS, but not via $_SERVER['PHP_AUTH_USER']
and $_SERVER['PHP_AUTH_PW']. Instead, these values must be parsed from another server global variable,
$_SERVER['HTTP_AUTHORIZATION']. So, for example, you need to parse out these variables like so:
list($user, $pswd) =
explode(':', base64_decode(substr($_SERVER['HTTP_AUTHORIZATION'], 6)));