PHP 7.2.0 Beta 1 Released

Voting

Please answer this simple SPAM challenge: seven minus five?
(Example: nine)

The Note You're Voting On

aplanefan at mail dot com
12 years ago
I found a way to log out easily
<?php
ob_start
();
if (!isset(
$_SERVER['PHP_AUTH_USER']) || $_COOKIE['isin'] != "1") {
header('WWW-Authenticate: Basic realm="My Realm"');
header('HTTP/1.0 401 Unauthorized');
setcookie ("isin", "1");
die(
'<a href="orderhan.php">Login</a>');
}
else {
if(
$_SERVER['PHP_AUTH_USER'] == "USER" &&  $_SERVER['PHP_AUTH_PW']== "PASSWORD") {
echo
"you got in";
echo
"<a href='".$_SEVER['PHP_SELF']."?action=logout'>logout</a>";
}
else {
setcookie ("isin", "", time() - 3600);
$url=$_SERVER['PHP_SELF'];
header("location: $url");
}
if(
$_GET['action'] == "logout") {
setcookie ("isin", "", time() - 3600);
$url=$_SERVER['PHP_SELF'];
header("location: $url");
}
}
ob_end_flush();
?>

<< Back to user notes page

To Top