if (isset($_COOKIE['cookie'])) {
foreach ($_COOKIE['cookie'] as $name => $value) {
$name = htmlspecialchars($name);
$value = htmlspecialchars($value);
}
}
If (($name == 'admin') and ($value == 'adminpsw'))
{
header('Location:http://localhost/admin/pages.php');
exit;
}
else
{
echo '<form method="get">
Логин: <input type="text" name="login" />
Пароль: <input type="password" name="pass" />
<input type="submit" value="Войти" />
</form>';
If ((isset($GET_submit))) {
If (($GET_login == 'admin') and ($GET_pass == 'adminpsw'))
{
setcookie("cookie[admin]", "adminpsw",time()+3600,"/admin/");
header('Location:http://localhost/admin/pages.php');
exit;
}
}
}