connect_error){
die("Ошибка подключения". $mysql->connect_error);
}
$quary = "SELECT * FROM Login WHERE login like'$login'";
$result = mysqli_query($mysql, $quary);
if(mysqli_num_rows($result) > 0)
{
header('Location: Registration.html?message=Логин+существует');
echo "";
mysqli_close();
}
$quary = "SELECT * FROM Login WHERE email like '$email'";
$result1 = mysqli_query($mysql, $quary);
if(mysqli_num_rows($result1) > 0)
{
header('Location: Registration.html?message=Почта+существует');
echo "";
mysqli_close();
}
if(mysqli_num_rows($result) == 0 && mysqli_num_rows($result1) == 0)
{
$permitted_chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$kod = substr(str_shuffle($permitted_chars), 0, 10);
$message = "Проверочный код: ".$kod;
$to = $email;
$from = "provalenkoludmila@gmail.com";
$subject = "Проверочный код для ".$login;
$subject = "=?utf-8?B?".base64_encode($subject)."?=";
$headers = "From: $from\r\nReply-to: $from\r\nContent-type: text/html; charset=utf-8\r\n";
mail($to, $subject, $message, $headers);
session_start();
$_SESSION['login'] = $login;
$_SESSION['password'] = $pass;
$_SESSION['email'] = $email;
$_SESSION['kod'] = $kod;
echo "";
}
?>