Hi.
Dunno What is happening...
When i exec this code it don't work.
When i run this file i see the dialog and i enter a user & password, but when i press OK i don't see what i've entered... and i have to press 3 times to see then the msg:
TEXT TO SEND IF USER HITS CANCEL BUTTON
and i haven't pressed cancel button !!
Ovbiously, when i press cancel button i see the msg... but
Why have i to press 3 times the OK button to see an error? What's wrong?
I've winnt 4 srv php4 apache 1.3.20 working fine (till now..) =)
<?php
if(!isset($PHP_AUTH_USER)) {
header("WWW-Authenticate: Basic realm=\"My Realm\"");
//header("HTTP/1.0 401 Unauthorized");
header("Status: 401 Unauthorized");
echo "Text to send if user hits Cancel button\n";
exit;
} else {
echo "<p>Hello $PHP_AUTH_USER.</p>";
echo "<p>You entered $PHP_AUTH_PW as your password.</p>";
}
?>