\n"; ++$errorCount; $retval = ""; } else {//Only clean up the input if it isn't empty $retval = trim($data); $retval = stripslashes($retval); } return $retval; } function validateEmail($data, $fieldName) { global $errorCount; if(empty($data)) { echo "\"$fieldName\" is a required field.
\n"; ++$errorCount; $retval = ""; } else { $retval = trim($data); $retval = stripslashes($retval); $pattern = "/^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)*(\.[a-z]{2,})$/i"; if (preg_match($pattern, $retval)==0) { echo "\"$fieldName\" is not a valid e-mail address.
\n"; ++$errorCount; } } return($retval); } function displayForm($Sender, $Email, $Subject, $Message) { ?>

Contact Me

Your Name:

Your Email :

Subject:

Message:

  

0) { echo "

Please re-enter the form information below.

\n"; } displayForm($Sender, $Email, $Subject, $Message); } else { $SenderAddress = "$Sender <$Email>"; $Headers = "From: $SenderAddress\nCC:$SenderAddress\n"; $result = TRUE; if ($result) { echo "

Your message has been sent. Thank you, " . $Sender . ".

\n"; } else { //This will never display because I removed the mail function and the variable $result is set // permanently to TRUE. echo "

There was an error sending your message, " . $Sender . ".

\n"; } } /*print_r ($_REQUEST); echo $errorCount; echo $Email; echo $Message; echo $Subject; echo $Sender; echo $showForm; */ ?>