Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <h1>Форма регистрации</h1>
- <title>header</title>
- </head>
- <body>
- <p>Введите логин и пароль.</p>
- <?php
- if(isset($_POST["knopka"]) && !empty($_POST["knopka"]))
- {
- $errors = "";
- $login = htmlspecialchars($_POST["login"]);
- $pass = htmlspecialchars($_POST["pass"]);
- $pass1 = htmlspecialchars($_POST["pass1"]);
- $email = htmlspecialchars($_POST["pochta"]);
- $age = htmlspecialchars($_POST["age"]);
- $radio = htmlspecialchars($_POST["sex"]);
- $radio1 = htmlspecialchars($_POST["sex"]);
- }
- if(empty($login))
- {
- $errors .= "Введите логин.<br>";
- }
- if(empty($pass) || $pass != $pass1)
- {
- $errors .= "Не был введён пароль или они не совпадают <br>";
- }
- if($age < 18 || $age > 90)
- {
- $errors .= "Введите корректный возраст <br>";
- }
- if(empty($email))
- {
- $errors .= "Введите электронную почту <br>";
- }
- if(empty($radio) && empty($radio1) )
- {
- $errors .= "Вы не ввели пол.<br>";
- }
- ?>
- <div id = "errors">
- <?=$errors?>
- <form action = "reg.php" method = "POST" type = ""><br>
- E-mail:
- <input type = "email" name = "pochta"><br>
- Введите возраст:
- <input type = "number" name = "age" ><br>
- Укажите пол:
- <label><input type = "radio" name = "sex">Мужской </label>
- <label><input type = "radio" name = "sex">Женский</label><br>
- Логин:
- <input type = "text" name = "login"><br>
- Пароль:
- <input type="password" name = "pass"><br>
- Введите пароль повторно:
- <input type = "password" name = "pass1"><br>
- <input type ="submit" name = "knopka" value = "Зарегистироваться"><br>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement