Password Protecting a directory
| From: | Todd Williamsen | Date: | Tue, 12 Feb 2002 16:19:44 +0000 |
| Subject: | Password Protecting a directory | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-12033@lists.php.net to get a copy of this message | ||
I have a variables.php file tha sets the username and password for the
directory, and it seems like its not executing.
the directory is recruiter/Admin and the file is put in there
function error ($error_message) {
echo $error_message."<BR>";
exit;
}
if ( (!isset($PHP_AUTH_USER)) || ! (($PHP_AUTH_USER == $LOGIN) && (
$PHP_AUTH_PW == "$PASSWORD" )) ) {
header("WWW-Authenticate: Basic entrer=\"Form2txt admin\"");
header("HTTP/1.0 401 Unauthorized");
error("Unauthorized access...");
}