PHP Authentication
| From: | Matt Greene | Date: | Wed, 01 Dec 1999 00:06:04 +0000 |
| Subject: | PHP Authentication | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-7141@lists.php.net to get a copy of this message | ||
How do i get this to open a file and check to see if it is the right login
and password?
Ok i have this so far
<?php
if(!isset($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 {
$MYDIR=ereg_replace( "/[^/]+$", "",$PHP_SELF);
Header( "Location: siteman.php3");
}
?>