note 4716 modified in header by ronabop
| From: | ronabop@php.net | Date: | Sun, 01 Oct 2000 06:57:27 +0000 |
| Subject: | note 4716 modified in header by ronabop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-5760@lists.php.net to get a copy of this message | ||
here us an example of a User Auth This is tried and proven on dtheatre.com:
if (!isset($PHP_AUTH_USER)) {
Header("WWW-Authenticate: Basic realm=\"Admin\"");
Header("HTTP/1.0 401 Unauthorized");
$REMOTE_USER = "";
$REMOTE_PASSWORD = "";
$PHP_AUTH_USER = "";
$PHP_AUTH_PW = "";
print "You hit cancel! if it was an accident please <a
href=\"$PHP_SELF\">click here</a> to try again.";
exit;
} else if ((!$PHP_AUTH_USER == "user") && ($PHP_AUTH_PW == "pass")) {
print "You are unauthorized";
}
http://www.php.net/manual/function.header.php