I am using HTTP authentication to restrict access to certain pages and I want to add a 
logout option so that users must reauthenticate before being able to veiw the pages 
again.
Here is the code I'm using to authenticate: 
<?
  /* Test for username/password */
  if(($PHP_AUTH_USER == $username) && ($PHP_AUTH_PW == $password)){
    startAdminPage();
    endPage();
  }
  else{
    /* Send headers to cause a browser to request username and password */
    header("WWW-Authenticate: Basic realm=\"Administrative Area\"");
    header("HTTP/1.0 401 Unauthorized");

    /* Show failure text */
    startPage();
    print("<P>This page requires a user name and password to view.<P>");
    endPage();
  }
?>

For the logout option I tried just setting $PHP_AUTH_USER="" and $PHP_AUTH_PW="" but 
that didn't work. Any ideas on how I can do this?

---
: David A. Dickson
: [EMAIL PROTECTED]




Get 250 color business cards for FREE!
http://businesscards.lycos.com/vp/fastpath/

-- 
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]

Reply via email to