Archive for the ‘Web Programming’ Category

htaccess logout - simple and works

Monday, February 4th, 2008

< ?php

$loginname = $_SERVER[’PHP_AUTH_USER’];
$password = $_SERVER[’PHP_AUTH_PW’];
if(!$user_info[’user_id’])
{
unset($user_info);
unset($loginname);
unset($password);
header(’HTTP/1.1 401 Unauthorized’);
header(’WWW-Authenticate: Basic realm=”Restricted Area”‘);
echo “Access Denied.”;
exit;
}
? >