File size: 935B
<?
#
# вход в админку
#
Error_Reporting(E_ALL & ~E_NOTICE);
include '../../inc/config.php';
include '../../inc/function.php';
if($_POST['sid'] == session_id())
{
if($_POST['login'] != '' && $_POST['pass'] != '')
{
$login = clean($login);
$query = @mysql_query("SELECT * FROM cat_user WHERE login='".$login."' LIMIT 1;");
$data = @mysql_fetch_array($query);
if($_POST['pass'] == $data['pass'])
{
$_SESSION['ip'] = $ip;
$_SESSION['session'] = session_id();
$_SESSION['id'] = $data['id'];
Header("Location: cabinet.php");
}
else
{
Header("Location: error.php");
exit;
}
}
else
{
Header("Location: error.php");
exit;
}
}
else
{
Header("Location: error.php");
exit;
}
?>