Hi,
I am reading HTTP authentication in php manual. It
does not explain it from the basics of it. Can anyone
tell me what exactly will the output of the following
code? I thought it will ask some user name and
password thing but it just displays me the string
"text to send if user hits cancel".
This is the code
<?php
header("WWW-Authenticate: Basic realm=\"My
Realm\"");
if (!isset($_SERVER['PHP_AUTH_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 "<p>Hello {$_SERVER['PHP_AUTH_USER']}.</p>";
echo "<p>You entered {$_SERVER['PHP_AUTH_PW']} as
your password.</p>";
}
?>
__________________________________________________
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php