[code]
if (isset($_COOKIE['uslog']) and isset($_COOKIE['uspass'])) {
$uslog = filter($_COOKIE['uslog']);
$uspass = filter($_COOKIE['uspass']);
$query = mysql_query("SELECT * FROM `users` WHERE `login` = '".$uslog."' and `pass` = '".$uspass."' LIMIT 1"
;
$user = mysql_fetch_assoc($query);
if (isset($user['id'])) {
if ($user['login'] != $uslog or $user['pass'] != $uspass) {
setcookie('uslog', '', time() - 86400*31);
setcookie('uspass', '', time() - 86400*31);
}
}
[/code]
Вопрос зачем код ниже
if (isset($user['id'])) {
if ($user['login'] != $uslog or $user['pass'] != $uspass) {
setcookie('uslog', '', time() - 86400*31);
setcookie('uspass', '', time() - 86400*31);
}
}