Файл: enter.php
Строк: 19
<?
define('PROTECTOR', 1);
if (isset($_SESSION['log']) && isset($_SESSION['pas']))
{
session_destroy();
setcookie('log', '');
setcookie('pas', '');
}
session_start();
$log = htmlspecialchars(stripslashes(addslashes($_POST['log'])));
$pas = htmlspecialchars(stripslashes(addslashes($_POST['pas'])));
/////////////////////////////////////////////////////
require_once ('files/db.php');//подключаем бд
/////////////////////
$pas=md5($pas);
$req = mysql_query("SELECT * FROM `users` WHERE `usr` = '".$log."' and `pass`='".$pas."' LIMIT 1");
////////////////////////////
$udata = mysql_fetch_array($req);
$avto=mysql_num_rows($req);
////////////////////////////////////////////////////////
////////////////////////////////////////////////////////
////////////////////////////////////////////////////////
if ($avto==1)
{
// Установка данных COOKIE
$clog = base64_encode($log);
$cpas = $pas;
setcookie("log", $clog, time() + 3600 * 24 * 365);
setcookie("pas", $cpas, time() + 3600 * 24 * 365);
$_SESSION['log'] = $log;
$_SESSION['pas'] = $pas;
include('files/exemple.php');
$daa=date('d.m.Y (H:i:s)');
mysql_query("INSERT INTO `global_info` SET
`id`='',
`ipv4`='".$ipv4."',
`ipv6`='".$ipv6."',
`br`='".$br."',
`br_vers`='".$br_vers."',
`os`='".$os."',
`os_vers`='".$os_vers."',
`screen`='".$screen."',
`screen_br`='".$screen_br."',
`host`='".$host."',
`con`='".$con."',
`usr`='".$udata['id']."',
`data`='".$daa."',
`gl`='".$_SERVER['HTTP_USER_AGENT']."'
");
header ("Location: game.php?");
}
else
{
header ("Location: index.php?error");
exit;
}
?>