note 62682 added to features.http-auth
| From: | larsgroenberg at gmail dot com | Date: | Tue, 07 Mar 2006 09:14:20 +0000 |
| Subject: | note 62682 added to features.http-auth | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-104965@lists.php.net to get a copy of this message | ||
How do I repeat getting the WWW-Authentication box up 3 times or until the user give me a username
and password that is in my database... I have no problem the first time but I can't get the
box up the second time....
I am working with the following code:
<?php
include('g_alle.php');
$link = dbConnect();
$login = logPaa();
$username = $_SERVER['PHP_AUTH_USER'];
$password = $_SERVER['PHP_AUTH_PW'];
$userID = auth($username, $password);
if ($userID == -1)
{
$login2 = logpaaIgen();
$username = $_SERVER['PHP_AUTH_USER'];
$password = $_SERVER['PHP_AUTH_PW'];
$userID = auth($username2, $password2);
}
g_alle.php
function logPaa() {
header('WWW-Authenticate: Basic realm="Indtast brugernavn og password"');
header('HTTP/1.0 401 Unauthorized');
exit;
}
function logpaaIgen() {
header('WWW-Authenticate: Basic realm="Indtast brugernavn og password"');
header('HTTP/1.0 401 Unauthorized');
exit;
}
----
Server IP: 66.163.161.117
Probable Submitter: 87.72.24.131 (proxied: 192.168.126.65)
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/features.http-auth.php
Edit -- http://master.php.net/note/edit/62682
Del: integrated -- http://master.php.net/note/delete/62682/integrated
Del: useless -- http://master.php.net/note/delete/62682/useless
Del: bad code -- http://master.php.net/note/delete/62682/bad+code
Del: spam -- http://master.php.net/note/delete/62682/spam
Del: non-english -- http://master.php.net/note/delete/62682/non-english
Del: in docs -- http://master.php.net/note/delete/62682/in+docs
Del: other reasons-- http://master.php.net/note/delete/62682
Reject -- http://master.php.net/note/reject/62682
Search -- http://master.php.net/manage/user-notes.php