<?php
$login = filter_input(INPUT_POST, 'login');
$pass = filter_var(trim($_POST['pass']),
FILTER_SANITIZE_STRING);
$pass = md5($pass."ghjsfkld2345");
$mysql = new mysqli('localhost','root','root','automoykaBase');
$result = $mysql->query("SELECT * FROM `users` WHERE `login` =
'$login' AND `pass` = '$pass'");
$user = $result ->fetch_assoc();
if(($user) == 0) {
echo "Такой пользователь не найден";
exit();
}
setcookie('user', $user['name'], time() + 3600, '/');
$mysql->close();
header('Location: Личный-кабинет.html');
?>