<?
$id = _string(_num($_COOKIE['id']));
$password = _string($_COOKIE['password']);
if($id && $password) {
$q = mysql_query('SELECT * FROM `users` WHERE `id` = "'.$id.'" AND `password` = "'.$password.'"');
$user = mysql_fetch_array($q);
if(!$user) {
setCookie('id', '');
setCookie('password', '');
}
}
?>