Forum Moderators: coopster
If is not set PHP_AUTH_USER send header 401.
If it is, connect to a db and get user's pwd.
If user doesn't exist send again header 401.
If user exist check if pwd's are the same.
If not, send again header 401.
If all went ok, document.location='file.php'
The little prob for me is the time lasting PHP_AUTH_USER, cos this script is for an intranet and some boxes will have 4 or 5 different users some days login in.
I need to unset this var, but:
unset ($_SERVER['HTTP_AUTH_USER']);
Some ideas to help this situation will be apreciated.
Regards
I understand this is the forum for php, but if I have to tell you, javascript is not something that I'm used to, always try to evoid it if I can.
Best regards.
But I was trying the script in the same box: server and client, and perhaps that's the reason for not soon vanishing of PHP_AUTH_USER.
If you can post in 2 lines how to 'destroy the browser' without using an axe I just would like to see it. :D
Thanks
you could have the final page after logout go to a page that has
<html>
<head>
<title></title>
</head>
<body onLoad="javascript:self.close();">
<p>Thank you and goodbye
</body>
<html>
problem is, and this I didn't know, IE shows a message about this window being closed and Moz errors out, not allowing a script to close a page it didn't open.
so this may not be an option.