Jump to content

Scoopsowl

New Members
  • Posts

    2
  • Joined

  • Last visited

Posts posted by Scoopsowl

  1. Thanks for the quick replies. Please find below the expanded code.

    Once again..many thanks

     

    // Validate email field.

     

    if(isset($_REQUEST['email']) && !empty($_REQUEST['email']))

    {

     

    $_REQUEST['email'] = trim($_REQUEST['email']);

     

    if(substr_count($_REQUEST['email'],"@") != 1 || stristr($_REQUEST['email']," ") || stristr($_REQUEST['email'],"\\") || stristr($_REQUEST['email'],":")){$errors[] = "Email address is invalid";}else{$exploded_email = explode("@",$_REQUEST['email']);if(empty($exploded_email[0]) || strlen($exploded_email[0]) > 64 || empty($exploded_email[1])){$errors[] = "Email address is invalid";}else{if(substr_count($exploded_email[1],".") == 0){$errors[] = "Email address is invalid";}else{$exploded_domain = explode(".",$exploded_email[1]);if(in_array("",$exploded_domain)){$errors[] = "Email address is invalid";}else{foreach($exploded_domain as $value){if(strlen($value) > 63 || !preg_match('/^[a-z0-9-]+$/i',$value)){$errors[] = "Email address is invalid"; break;}}}}}}

     

    }

  2. Hi,

    I am new to php programming but found a script that checks email validation. The script works fine but instead of displaying the error message "Email address is invalid" I would like the script to go to an error page that I have designed. Below is a section of the script I am using. Any ideas?

     

    stristr($_REQUESTemail," ")){$errors[] = "Email address is invalid";}else{$

     

    Thanks

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.