File size: 565B
<?
if(!empty($_SESSION['id']) and !empty($_SESSION['pass']))
{
$result_log = mysql_query("select * from user where id='$_SESSION[id]' and pass='$_SESSION[pass]'");
$tot_result_log = mysql_num_rows($result_log);
if($tot_result_log == 1)
{
$id = $_SESSION['id'];
$pass = $_SESSION['pass'];
mysql_query("UPDATE `prof` SET `on` = '".time()."' where `id` = '$id'");
}
else
{
session_destroy();
header("Location: index.php");
}
}
else
{
$err='<h3>Вы не авторизованы!</h3>';
}
if($id == $admin)
{$admin = true;}
else
{$admin = false;}
?>