connect_error){ die("Ошибка подключения". $mysql->connect_error); } $kod = $_POST["check"]; session_start(); $name = $_SESSION['name']; $surname = $_SESSION['surname']; $login = $_SESSION['login']; $pass = $_SESSION['password']; $email = $_SESSION['email']; if($kod == $_SESSION['kod']) { $query = "INSERT INTO login (`name`,`lastname`,`login`, `email`, `password`) VALUES ('$name', '$surname', '$login', '$email', '$pass')"; if($result = $mysql->query($query)) { $_SESSION['name'] = $name; $_SESSION['surname'] = $surname; $_SESSION['login'] = $login; $_SESSION['password'] = $pass; $_SESSION['email'] = $email; echo ""; } } else header('Location: EmailCheck.php?message=Неверный+код'); echo ""; mysqli_close(); ?>