SHARE
TWEET

Untitled

a guest Mar 20th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. error_reporting(E_ALL);
  3. ini_set('display_errors', 1);
  4. // define variables and set to empty values
  5. $firstNameErr = $emailErr = $lastNameErr = $passwordErr = $phoneNumberErr = "";
  6. $email = $firstName = $lastName = $password = $phoneNumber = "";
  7.  
  8. if ($_SERVER["REQUEST_METHOD"] == "POST") {
  9.   if (filter_var($_POST["email"]),FILTER_VALIDATE_EMAIL) {
  10.     $emailErr = "Email is valid";
  11.   } else {
  12.     $emailErr = "Email is invalid";
  13.   }
  14.  
  15.   if (filter_var($_POST["password"])) {
  16.     $passwordErr = "Password is valid";
  17.   } else {
  18.     $passwordErr = "Password is invalid";
  19.   }
  20.  
  21.   if (filter_var($_POST["firstName"])) {
  22.     $firstNameErr = "First Name is valid";
  23.   } else {
  24.     $firstNameErr = "First Name is invalid";
  25.   }
  26.  
  27.   if (filter_var($_POST["lastName"])) {
  28.     $lastNameErr = "Last Name is valid";
  29.   } else {
  30.     $lastNameErr = "Last Name is invalid";
  31.   }
  32.  
  33.   if (filter_var($_POST["phoneNumber"])) {
  34.     $phoneNumberErr = "Phone Number is valid";
  35.   } else {
  36.     $phoneNumberErr = "Phone Number is invalid";
  37.   }
  38. }
  39. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top