php email _POST email password _POST password mysqli new mysqli localh

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
<?php
$email=$_POST['email'];
$password=$_POST['password'];
$mysqli = @new mysqli('localhost', 'root', '', 'users');
if (mysqli_connect_errno()) {
echo "Подключение невозможно: ".mysqli_connect_error();
}
$query = mysqli_query($mysqli,"SELECT User, Password FROM login WHERE User='".mysqli_real_escape_string($mysqli,$email)."' LIMIT 1");
$data = mysqli_fetch_assoc;
if ($data['Password'] == $password)
echo("Привет $email");
?>