<?php
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$login = filter_var(trim($_POST['login']),FILTER_SANITIZE_STRING);
$pass = filter_var(trim($_POST['pass']),FILTER_SANITIZE_STRING);
$mysql = new mysqli('localhost','u1028892_miruser','2V7f91E3k','u1028892_mir');
$result=$mysql->query("SELECT * FROM `users` WHERE `login`='$login' AND `pass`='$pass'") ;
$user=$result->fetch_assoc();
if (!$user) {
echo "Такой пользователь не найден";
exit;
}
else
setcookie('user', $user['name'], time()+3600,"/mir");
$mysql->close();
header('location: /mir' );
?>