Advertisement
Guest User

Untitled

a guest
Dec 2nd, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. <?php
  2. // define variables and set to empty values
  3. $nameErr = $emailErr = $cognomeErr = $passwordErr = $cpasswordErr = "";
  4. $name = $email = $cognome = $username = $password = $cpassword = "";
  5.  
  6. if ($_SERVER["REQUEST_METHOD"] == "POST") {
  7. if (empty($_POST["name"])) {
  8. $nameErr = "Name is required";
  9. } else {
  10. $name = test_input($_POST["name"]);
  11. }
  12.  
  13. if (empty($_POST["email"])) {
  14. $emailErr = "Email is required";
  15. } else {
  16. $email = test_input($_POST["email"]);
  17. }
  18.  
  19. if (empty($_POST["cognome"])) {
  20. $cognomeErr = "cognome is required";
  21. } else {
  22. $cognome = test_input($_POST["cognome"]);
  23. }
  24.  
  25. if (empty($_POST["username"])) {
  26. $usernameErr = "username is required";
  27. } else {
  28. $username = test_input($_POST["username"]);
  29. }
  30.  
  31. if (empty($_POST["password"])) {
  32. $passwordErr = "password is required";
  33. } else {
  34. $password = test_input($_POST["password"]);
  35. }
  36. if (empty($_POST["cpassword"])) {
  37. $cpasswordErr = "confirm password is required";
  38. } else {
  39. $cpassword = test_input($_POST["cpassword"]);
  40. }
  41. }
  42. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement