-
SitePoint Member
$PHP_AUTH_USERS how to unset
<?php
I have this cod in my login script
$auth=false;
if (isset($PHP_AUTH_USER) && isset($PHP_AUTH_PW)) {
include_once("conn.php");
$sql="SELECT * FROM users WHERE users='$PHP_AUTH_USER' AND u_password = '$PHP_AUTH_PW'";
$rs= @mysql_query($sql,$db) or die (mysql_error());
if (@mysql_numrows($rs) != 0){
$auth=true;
}
else
{
$auth =false;
}
}
if(!$auth){
header("WWW-Authenticate: Basic realm " );
header('HTTP/1.0 401 Unauthorized' );
echo "Sorry this page is protected";
exit;
}
?>
That's work prety good, now my problem is how to logout...
I try
unset($PHP_AUTH_USER);
unset($PHP_AUTH_PW);
but not working... I try also
$PHP_AUTH_USER ="";
$PHP_AUTH_PW ="";
but still I can't logout... any help is highly apreciated
thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks