note 105379 added to features.http-auth
| From: | luismontreal at gmail dot com | Date: | Fri, 12 Aug 2011 21:10:04 +0000 |
| Subject: | note 105379 added to features.http-auth | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-182458@lists.php.net to get a copy of this message | ||
Using sessions like this makes the enter auth values at each request
if($_SESSION['http_logged'] != 1) {
$_SERVER['PHP_AUTH_USER'] = '';
$_SERVER['PHP_AUTH_PW'] = '';
}
if ($_SERVER['PHP_AUTH_USER'] != $your_username || $_SERVER['PHP_AUTH_PW']
!= $your_password ) {
$_SESSION['http_logged'] = 1;
header('WWW-Authenticate: Basic realm="realm"');
header('HTTP/1.0 401 Unauthorized');
exit;
} else {
$_SESSION['http_logged'] = 0;
}
----
Server IP: 69.147.83.197
Probable Submitter: 68.67.54.34
----
Manual Page -- http://www.php.net/manual/en/features.http-auth.php
Edit -- https://master.php.net/note/edit/105379
Del: integrated -- https://master.php.net/note/delete/105379/integrated
Del: useless -- https://master.php.net/note/delete/105379/useless
Del: bad code -- https://master.php.net/note/delete/105379/bad+code
Del: spam -- https://master.php.net/note/delete/105379/spam
Del: non-english -- https://master.php.net/note/delete/105379/non-english
Del: in docs -- https://master.php.net/note/delete/105379/in+docs
Del: other reasons-- https://master.php.net/note/delete/105379
Reject -- https://master.php.net/note/reject/105379
Search -- https://master.php.net/manage/user-notes.php