RE: [PHP] HELP!!! $PHP_AUTH_USER!!!!!!
| From: | Robert Collins | Date: | Tue, 23 Jan 2001 17:06:54 +0000 |
| Subject: | RE: [PHP] HELP!!! $PHP_AUTH_USER!!!!!! | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-36221@lists.php.net to get a copy of this message | ||
Try this:
<?
function authUser($username,$password,$realm,$message) {
if (isset($GLOBALS["PHP_AUTH_USER"]) && (($GLOBALS["PHP_AUTH_USER"]
!= $username) || ($GLOBALS["PHP_AUTH_PW"] != $password))) {
header("WWW-Authenticate: Basic realm=\"$realm\"");
header("HTTP/1.0 401 Unauthorized");
echo $message;
exit;
} elseif (!isset($GLOBALS["PHP_AUTH_USER"])) {
header("WWW-Authenticate: Basic realm=\"$realm\"");
header("HTTP/1.0 401 Unauthorized");
echo $message;
exit;
}
return true;
}
authUser("test","test","mine","You are not permited to access
this
area!<BR><BR>try:<BR>password : test<BR>username : test");
$title = "Password";
echo "OK, you can look at this page!";
?>
-----Original Message-----
From: Bruno Freire [mailto:bruno@fujinor.com.br]
Sent: Tuesday, January 23, 2001 10:45 AM
To: 'php-general@lists.php.net'
Subject: [PHP] HELP!!! $PHP_AUTH_USER!!!!!!
Look....
I justs wanna make that password box show up in the screen....
But without a protected directory...
Thanks
Bruno