<?php
include 'dbc.php';
if(isset($_COOKIE['login'], $_COOKIE['pass'])){
$query = $dbc->query("SELECT * FROM `users` WHERE `login`='".$dbc->real_escape_string($_COOKIE['login'])."' AND `pass`='".$dbc->real_escape_string($_COOKIE['pass'])."' LIMIT 1 ");
// поиск пользователя в системе
$user = (mysqli_num_rows($query) == 1) ? mysqli_fetch_assoc($query) : 0;
}
else{
	$user = 0;
}if($user['id']>0){$dbc->query("UPDATE `users` SET `time`=".time()." WHERE `id`='".$user['id']."'");
}
