define('ADMIN_PASS', 'inko');
if (isset($_POST['password'])) {
$password = md5($_POST['password']);
if ($password == md5(ADMIN_PASS)) {
setcookie('password', $password);
}
} elseif (isset($_GET['password'])) {
$password = md5($_GET['password']);
if ($password == md5(ADMIN_PASS)) {
setcookie('password', $password);
}
} elseif (isset($_GET['func']) && $_GET['func'] == 'logout' ) {
setcookie ('password', '');
unset($_COOKIE['password'], $password);
$password = NULL;
} else {
$password = isset($_COOKIE['password']) ? $_COOKIE['password'] : NULL;
}
?>
Anthony Orsatti