Ok, I set up PHP with IIS, works fine, and here is the code that I tried :
<?php
if(!isset($REMOTE_USER)) {
Header("WWW-Authenticate: Basic realm=\"My Realm\"");
Header("HTTP/1.0 401 Unauthorized");
echo "Text to send if user hits Cancel button\n";
exit;
} else {
echo "Hello. You made it in.";
}
?>
However, I never get the dialog box asking for the username/password, only the echo. I switched to Apache, and it went into the loop (since the login/password sets $PHP_AUTH_USER, it seems), and I hadn't changed a line of code. Is there some setting within IIS that I have to set so that it starts to recognize (and send) the headers?
SCT