Advertisement
Guest User

Untitled

a guest
Apr 21st, 2018
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. <?php
  2. require "header.php";
  3. ?>
  4.  
  5. <?php
  6. if ($_POST["Create"] === "submit") {
  7. $name = preg_match("/[A-Z][a-z]+/",$_POST["name"]);
  8. $tel = preg_match("/\d{10}/", $_POST["phone"]);
  9. $email = preg_match("/\w+@(gmail||yahoo).com/", $_POST["email"]);
  10. $pass = strcmp($_POST["password"], $_POST["rpassword"]);
  11.  
  12. if($name == 0) {
  13. $_POST["name"] = "Incorrect name";
  14. }
  15. if($tel == 0) {
  16. $_POST["phone"] = "Incorrect phone number";
  17. }
  18. if($email == 0) {
  19. $_POST["email"] = "Incorrect email";
  20. }
  21. }
  22. ?>
  23.  
  24. <div class="login_box" id="cr_acc_box:">
  25. <form action = "create_account.php" method = "POST">
  26. <fieldset>
  27. <legend>Create account:</legend>
  28. Name: <input type = "text" name = "name" value = "<?php echo $_POST["name"]?>"> <br><br>
  29. Username: <input type = "text" name = "Username" value = "<?php echo $_POST["Username"]?>"> <br><br>
  30. Telephone number: <input type="text" name="phone" value = "<?php echo $_POST["phone"]?>"> <br><br>
  31. E-mail: <input type="text" name="email" value="<?php echo $_POST["email"]?>"><br><br>
  32. Password: <input type="password" name="password" value="<?php echo $_POST["password"]?>"><br><br>
  33. Retype password: <input type="password" name="rpassword" value="<?php echo $_POST["rpassword"]?>"><br><br>
  34. <span id="submit"><input type="submit" name="Create" value="submit"></span>
  35. </fieldset>
  36. </form>
  37. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement