if isset _COOKIE id _COOKIE pass query DB dbs query SELECT FROM blogge

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
if (isset ($_COOKIE['id'], $_COOKIE['pass'])) {
$query = DB :: $dbs -> query ("SELECT * FROM `blogger` WHERE (`id`=?) AND (`pass`=?)", array (intval ($_COOKIE['id']), addslashes ($_COOKIE['pass'])));
if ($query -> rowCount () != 0) {
$b = $query -> fetch ();
// update activity
DB :: $dbs -> query("UPDATE `blogger` SET `last`='" . time () . "',`ip`=?,`soft`=? WHERE (`id`='" . $b['id'] . "')", array ($_SERVER['REMOTE_ADDR'], $_SERVER['HTTP_USER_AGENT']));
}
}