EmailCheck.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. $host = "kurek620.beget.tech";
  3. $username = "kurek620_baze";
  4. $password = "6910WASD579h";
  5. $database = "kurek620_baze";
  6. $kod = $_POST["check"];
  7. $mysql = new mysqli($host, $username, $password, $database);
  8. // Проверка соединения
  9. if($mysql->connect_error){
  10. die("Ошибка подключения". $mysql->connect_error);
  11. }
  12. session_start();
  13. $Email = $_SESSION['Email'];
  14. $login = $_SESSION['login'];
  15. $passwor = $_SESSION['password'];
  16. $region = $_SESSION['region'];
  17. $FIO = $_SESSION['FIO'];
  18. if($kod == $_SESSION['kod'])
  19. {
  20. $query = "INSERT INTO ZUsers (`FIO`, `region`, `login`, `Email`, `password`) VALUES ('$FIO', '$region', '$login', '$Email', '$passwor')";
  21. if($result = $mysql->query($query))
  22. {
  23. $_SESSION['login'] = $login;
  24. $_SESSION['password'] = $passwor;
  25. echo "<script>window.location.href = 'index.html';</script>";
  26. }
  27. }
  28. else
  29. header('Location: EmailCheck.html?message=Неверный+код');
  30. echo "<script>window.location.href = 'EmailCheck.html';</script>";
  31. mysqli_close();
  32. ?>