[code=php]
<?PHP
if (!isset($_SERVER[‘PHP_AUTH_USER’]) || $_COOKIE[‘isin’] != “1”) {
header(‘WWW-Authenticate: Basic realm=”My Realm”‘);
header(‘HTTP/1.0 401 Unauthorized’);
echo(“This is for authorized users only.”);
}else {
if($_SERVER[‘PHP_AUTH_USER’] == “1” && $_SERVER[‘PHP_AUTH_PW’]== “2”) {
echo “you got in”;
}else{
echo “wrong”;
}
}
?>
what’s wrong with this sample?
after i type in user = 1 and password = 2, it cant echo “you got in” nor “wrong”;
and another question is the redirect problem:
[code=php]
$sec = 1;
// Redirects the browser after $sec seconds
header(“Refresh: $sec; http://www.php.net”);
echo “This content is displayed for $sec seconds, then the browser will redirect.”;
it dont seems like direct to [url]www.php.net
is it need some changes in my php.ini?