Файл: autorizations.php
Строк: 29
<?php
include 'inc/mysql.php';
include 'inc/check.php';
include ("inc/head.php");
if(isset($_SESSION['auth']) && $_SESSION['auth']==1){
header ("Location: home.php?");
exit;
}
$login = mysql_real_escape_string($_POST['login']);
$password = mysql_real_escape_string($_POST['password']);
if(empty($login) or empty($password)){ header ("Location: index.php?act=not_pers");
exit; }
$user = mysql_fetch_array(mysql_query("SELECT * FROM `account` WHERE `login`='".$login."' and `password`='".$password."'"));
if(empty($user)){
header ("Location: index.php?act=not_pers");
exit;
}
if ($err){ foreach($err as $value){ echo "".$value."";
}
exit;
}else{
//if ($user['id']==1 OR $user['id']==2){
$_SESSION['id']=$user['id'];
$_SESSION['login']=$user['login'];
$_SESSION['password']=$user['password'];
$_SESSION['auth']=1;
header ("Location: home.php?");
}
include ("inc/nogi.php");
?>