Hi all, I'm trying to add email validation to a form but don't exactly know where to put it. I would like to add the code found HERE but don't know where it should go on the page. What I have right now is
Thanks.Code:<? $errors=0; $error="The following errors occured while processing your form input.<ul>"; $_POST['firstname']=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $_POST['firstname']);if($_POST['firstname']=="" || $_POST['lastname']=="" || $_POST['email']=="" || $_POST['comments']=="" ){ $errors=1; $error.="<li>You did not enter one or more of the required fields. Please go back and try again."; } if($errors==1) $msg.="You did not enter one or more of the required fields.<br />Please go back and re-enter your contact request."; else{ $where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$_SERVER['HTTP_HOST'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/")); $message=" Firstname: ".$_POST['firstname']." Lastname: ".$_POST['lastname']." Email: ".$_POST['email']." Address: ".$_POST['address']." City: ".$_POST['city']." State: ".$_POST['state']." Zip: ".$_POST['zip']." Phone: ".$_POST['phone']." Interested: ".$_POST['interested']." Comments: ".$_POST['comments']." "; mail("someone@somewhere.com","Stuff",$message,"From: Web Form");f mail("$email","Thank you for contacting us", "Hi $firstname,\n Thank you for contacting us!\n We will respond to your enquiry as soon as possible.\n\n\n Thanks.; $msg.="Thank you!<br />Your enquiry has been submitted and we will respond as soon as we can."; } ?>

LinkBack URL
About LinkBacks






Bookmarks