addValidation("Name","req","Please fill in your Name");
$validator->addValidation("Email","email","The input for the Email should be a valid email value email@eamil.com");
$validator->addValidation("Email","req","Please fill in your Email");
//$validator->addValidation("City","req","Please fill in City");
//$validator->addValidation("url","req","Please fill in URL");
//$validator->addValidation("rlink","req","Please fill in Reciprocal Link");
//$validator->addValidation("title","req","Please fill in the Website Title");
//$validator->addValidation("description","maxlen=250","Please fill in the Website Description");
//$validator->addValidation("zip","num","Zip code needs to be a Number");
$custom_validator = new MyValidator();
$validator->AddCustomValidator($custom_validator);
if($validator->ValidateForm())
{
//Start ad in code for godaddy mail
$to = $_REQUEST['sendto'];
$subject = 'Inquiry from your web site';
$message = 'From: ' . $_REQUEST['Name'] . "\n\n" . $_REQUEST['data'];
$email = $_REQUEST['Email'];
$headers = 'From: ' . $email . "\r\n" .
'Reply-To: ' . $email . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail ($to, $subject, $message, $headers);
//header("Location: contact2.php?action=Contact&m=1");
// add in Database code here
echo "
Your e-mail was sent successfully!
";
$show_form=true;
}
else
{
echo "
Oops you missed a required field. Please go back and add the missing information.";
$error_hash = $validator->GetErrors();
foreach($error_hash as $inpname => $inp_err)
{
echo "
$inpname : $inp_err
\n";
}
}
}
if(true == $show_form)
{
?>
Your Message has been sent ");
}
else { }
}
?>