if(eregi('warwick\.ac\.uk', $_POST['registrant_email']) && (strlen($_POST['registrant_email'])>0)) { $_POST['registrant_email'] = quote($_POST['registrant_email']); } else { $_POST['registrant_email'] = NULL; $message .= "email address must be in the format @warwick.ac.uk "; }