note 43126 added to features.http-auth
| From: | martinoatdorifordotcom at rn2 dot php dot net | Date: | Thu, 10 Jun 2004 08:52:56 +0000 |
| Subject: | note 43126 added to features.http-auth | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-70848@lists.php.net to get a copy of this message | ||
I am using the authentication code below on two sites and it works on one, but not on the other. I
asked my ISP about it and they are puzzled. Aparently, the only difference is that the site that
works is on Apache v1.3, but the one that doesn't is on Apache v2. I haven't found the
answer to the problem yet, but hope someone does.
<?php
if ($_SERVER['PHP_AUTH_USER'] <> 'someuser' ||
$_SERVER['PHP_AUTH_PW'] <> 'somepass') {
header('WWW-Authenticate: Basic realm="Some Site"');
header('HTTP/1.0 401 Unauthorized');
echo 'Login failed.';
exit;
}
?>
Martino
----
Manual Page -- http://www.php.net/manual/en/features.http-auth.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+43126
Delete -- http://master.php.net/manage/user-notes.php?action=delete+43126&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+43126&report=yes
Search -- http://master.php.net/manage/user-notes.php