We Recommend

Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems
Wicked Cool PHP contains a wide variety of scripts to process credit cards, check the validity of email addresses, template HTML, and serve dynamic images and text.


Posted By

paulbooker on 11/15/08


Tagged

form email validation


Versions (?)


Email form validation


Published in: PHP 


  1. function validate_email($email) {
  2. global $SERVER_SIDE_FORM_VALIDATION;
  3. global $VALIDATION_ERROR;
  4. if (!ereg("^(.+)@(.+)\\.(.+)$", $email)) {
  5. $SERVER_SIDE_FORM_VALIDATION = false ;
  6. $VALIDATION_ERROR['email'] = true ;
  7. }
  8. return ;
  9. }

Report this snippet 

You need to login to post a comment.