RE: [PHP] Forcing htaccess login again
| From: | Sander Pilon | Date: | Mon, 26 Feb 2001 23:26:31 +0000 |
| Subject: | RE: [PHP] Forcing htaccess login again | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-41758@lists.php.net to get a copy of this message | ||
The request for a password is usually generated by a 401 header. Just do
this -
Header("WWW-authenticate: basic realm=\"Some realm\"");
Header("HTTP/1.1 401 Unauthorized");
exit;
That should pop up a box. Just make sure you check the values of
$PHP_AUTH_USER/PW first before presenting those headers.
This is more of an http question then it is a php question, I strongly
advise you to read and understand the HTTP/1.1 rfc - it can be found at
http://www.faqs.org/rfcs/rfc2616.html
(See chapter 10.4.2 for the documentation of the 401 header)
Regards,
Sander
> -----Original Message-----
> From: Chris Aitken [mailto:chris@ideal.net.au]
> Sent: 27 February 2001 00:12
> To: php-general@lists.php.net
> Subject: [PHP] Forcing htaccess login again
>
>
> Now im even getting more confused. Ive been doing some more research into
> the subject, and cant seem to find any answers.
>
> All of the PHP documentation about headers() talks about auth via
> PHP, but
> doesnt mention anything about htaccess as the auth system.
>
> On my main.php screen, this is where the cookie gets set once the
> user logs
> in with htaccess. What im trying to do is incorporate a section into
> (possibly) main.php which forces the htaccess to rerequest login again
> using my .htpasswd password file as the criteria.
>
> Is there some sort of header information which will make the
> webserver turn
> around and say..... "Hey, you shouldnt be here anymore, login again and I
> might think about letting you in"
>
> Because once I can get the user logging in again, it will go to
> the rest of
> main.php and unset/reset the cookie with the new user.
>
>
> Scratching my head.
>
>
>
> Chris
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>