Размер файла: 930B
<?
include('core/core.php');
include(INC.'func.php');
include(INC.'session.php');
include(INC.'session_user.php');
include(INC.'head.php');
show_title('Вход в систему');
$login = htmlspecialchars($_GET['login']);
$pass = htmlspecialchars($_GET['pass']);
if($login == !NULL && $pass == !NULL){
$pass1 = sha1(md5(md5(sha1($pass))));
$q = mysql_query('SELECT * FROM users WHERE login = "'.$login.'"');
$p = mysql_query('SELECT * FROM users WHERE pass = "'.$pass1.'"');
if(mysql_num_rows($q) != 0){
if(mysql_num_rows($p) != 0){
include(MODUL.'reg/reg.php');
header("Location: ".$start_dir."");
setcookie("login",$login,time()+1800,'/');
setcookie("pass",$pass1,time()+1800,'/');
$data = date("d.m.Y в H:i");
$ip = preg_replace('|[^0-9\.]|', '', $_SERVER['REMOTE_ADDR']);
mysql_query("UPDATE `users` SET `last`='$data',`ip`='$ip' WHERE login = '".$login."'");
}
}
}
include(INC.'foot.php');
?>