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:[EMAIL PROTECTED]]
> Sent: 27 February 2001 00:12
> To: [EMAIL PROTECTED]
> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]