Click to order
 
require_once('tamplates/top.php'); if($_POST){ $p_email = $_POST['email']; $p_password = $_POST['password']; $errors = array(); if(!$p_email){ $errors[] = "Поле email не заполнено"; } if(!$p_password){ $errors[] = "Поле password не заполнено"; } if(!empty($errors)){ print_r($errors); } $query = "SELECT*FROM users WHERE email='$p_email' AND password='$p_password'"; $adr = mysqli_query($db_con, $query); if(!$adr){ exit($query); } $user = mysqli_fetch_array($adr); if(empty($user)){ $errors[] = "error log-in"; } if(!empty($errors)){ exit('error'); } else { $_SESSION['user_id']=$user['id']; ?>