Hi,
I have a simple question, but I can't find the answer anywhere:
I have a series of page secured with the well known script here below.
However, the only way for the browser to forget the user/password
combination is to quit the browser. Is there another way and if yes, which
one.?
Ideally I would like to create a button or link on the secured pages which
says <log-out> after which the user is brought back to the non-secured
wellcome page (via javascript for instance).
Any suggestion is welcome. Thanks in advance!
Herman
<?
// File Name: auth.php
// Check to see if $PHP_AUTH_USER already contains info
if (!isset($PHP_AUTH_USER)) {
// If empty, send header causing dialog box to appear
header('WWW-Authenticate: Basic realm="Infonomics"');
header('HTTP/1.0 401 Unauthorized');
echo 'Authorisation required.';
exit;
} elseif (isset($PHP_AUTH_USER)) {
if (($PHP_AUTH_USER == "user1" and $PHP_AUTH_PW != "password1")
or ($PHP_AUTH_USER == "user2" and $PHP_AUTH_PW != "password2")) {
header('WWW-Authenticate: Basic realm="Infonomics"');
header('HTTP/1.0 401 Unauthorized');
echo 'Authorisation required.';
exit;
}
}
?>
--
International Institute of Infonomics
PO Box 2606
NL-6401 DC Heerlen
the Netherlands
tel: +31 45 570 76 90
fax: +31 45 570 62 62
web: http://www.infonomics.nl
For a free weekly digest of ICT news delivered directly to your email box,
go to http://www.infonomics.nl/subscribe_ict.htm and subscribe to "ICT
Weekly".