note 3653 modified in features.http-auth by irc-html
| From: | irc-html@php.net | Date: | Sat, 19 Jan 2002 20:26:34 +0000 |
| Subject: | note 3653 modified in features.http-auth by irc-html | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-25304@lists.php.net to get a copy of this message | ||
I had the same problem as above (that is, with apache I can't get the auth info). The solution
I found goes like this:
$headers = getallheaders();
$auth=$headers[authorization];
if ($auth=='') { $auth=$headers[Authorization]; }
if($auth=='')
{
Header("WWW-Authenticate: Basic realm=\"$PROG_NAME\"");
Header("HTTP/1.0 401 Unauthorized");
}
list($user, $pass) = explode(":", base64_decode(substr($auth, 6)));
--was--
I had the same problem as above (that is, with apache I can't get the auth info). The solution
I found goes like this:
<PRE>
$headers = getallheaders();
$auth=$headers[authorization];
if ($auth=='') { $auth=$headers[Authorization]; }
if($auth=='')
{
Header("WWW-Authenticate: Basic realm=\"$PROG_NAME\"");
Header("HTTP/1.0 401 Unauthorized");
}
list($user, $pass) = explode(":", base64_decode(substr($auth, 6)));
</PRE>
http://www.php.net/manual/en/features.http-auth.php