Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. <DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <h1>Форма регистрации</h1>
  6. <title>header</title>
  7. </head>
  8. <body>
  9. <p>Введите логин и пароль.</p>
  10. <?php
  11. if(isset($_POST["knopka"]) && !empty($_POST["knopka"]))
  12. {
  13. $errors = "";
  14. $login = htmlspecialchars($_POST["login"]);
  15. $pass = htmlspecialchars($_POST["pass"]);
  16. $pass1 = htmlspecialchars($_POST["pass1"]);
  17. $email = htmlspecialchars($_POST["pochta"]);
  18. $age = htmlspecialchars($_POST["age"]);
  19. $radio = htmlspecialchars($_POST["sex"]);
  20. $radio1 = htmlspecialchars($_POST["sex"]);
  21.  
  22. }
  23. if(empty($login))
  24. {
  25. $errors .= "Введите логин.<br>";
  26. }
  27. if(empty($pass) || $pass != $pass1)
  28. {
  29. $errors .= "Не был введён пароль или они не совпадают <br>";
  30. }
  31. if($age < 18 || $age > 90)
  32. {
  33. $errors .= "Введите корректный возраст <br>";
  34. }
  35. if(empty($email))
  36. {
  37. $errors .= "Введите электронную почту <br>";
  38. }
  39. if(empty($radio) && empty($radio1) )
  40. {
  41. $errors .= "Вы не ввели пол.<br>";
  42. }
  43. ?>
  44. <div id = "errors">
  45. <?=$errors?>
  46. <form action = "reg.php" method = "POST" type = ""><br>
  47. E-mail:
  48. <input type = "email" name = "pochta"><br>
  49. Введите возраст:
  50. <input type = "number" name = "age" ><br>
  51. Укажите пол:
  52. <label><input type = "radio" name = "sex">Мужской </label>
  53. <label><input type = "radio" name = "sex">Женский</label><br>
  54. Логин:
  55. <input type = "text" name = "login"><br>
  56. Пароль:
  57. <input type="password" name = "pass"><br>
  58. Введите пароль повторно:
  59. <input type = "password" name = "pass1"><br>
  60. <input type ="submit" name = "knopka" value = "Зарегистироваться"><br>
  61. </form>
  62. </body>
  63. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement