".$_POST['name'].",

Your query '". htmlspecialchars(stripslashes(strip_tags(trim($_POST['comments']))))."' has been e-mailed to $ouremail.

We have also forwarded a copy of this email to ".$_POST['email'].".

WonderClub Enterprises appreciates all comments provided by our customers.

We strive to answer all questions within 48 hours.

Thank You!
WonderClub Enterprises"; // Convert Caps to lower case and then to Title Case. $name = ucfirst(strtolower($name)); // Set Constants. $ouremail = '[email protected]'; $body = " Name: $name Query: $comments Email: $email"; // Handle the form if (isset($_POST['submit'])) { // Check for a name. if (strlen($_POST['name']) > 0) { $nameerror = ""; $name = TRUE; } else { $name = FALSE; $nameerror = 'You forgot to enter your name!'; } // Check for email address. if (strlen($_POST['email']) > 0) { $email = TRUE; $emailerror = ""; } else { $email = FALSE; $emailerror = 'You forgot to enter your email address!'; } // Check for valid email address. if (preg_match("/^[^@][email protected][^@]+\.[a-z]{2,6}$/i",($_POST['email']))) { $emailerror = ""; $validemail = TRUE; } else { $emailerror = 'Please enter a valid e-mail address (example: [email protected]).

'; $validemail = FALSE; } // Check for comments. // if (eregi ("^[[:alnum:][:blank:][:space:][:cntrl:][:print:][:punct:]]{10,}$", mysqli_real_escape_string(stripslashes(trim($_POST['comments']))))) { if ( strlen( $_POST['comments']) >= 10 && strlen($_POST['comments']) <= 256 ) { $commentserror = ""; $validcomments = TRUE; } else { $commentserror = '
Please enter a comment or message. A message must be a minimum of 10 characters & a maximum of 256 characters.
'; $validcomments = FALSE; } // Send an email if everything is okay. if ($name && $email && $validemail && $validcomments) { mail($ouremail, 'Thank you for your submission', " $thankyoustatement ", "From: WonderClub Enterprises <$ouremail>\n" . "MIME-Version: 1.0\n" . "Content-type: text/html; charset=iso-8859-1"); // Display a thank you message when question is successfully entered. echo '

'; echo $thankyoustatement; echo '
'; $display = "Off"; } else { echo 'There was an error with your entry. Please correct the errors shown in red.'; } } if ( (isset($display)) && ($display == "Off") ) { } else { echo '

WONDERCLUB E-MAIL FORM

We are always happy to respond to our customers queries. We need your e-mail address in order to reply to you.
Please enter your name, e-mail address and question or comment in this form

              Name: '; echo $nameerror; $nameerror = ""; echo '

Email Address: '; echo "$emailerror"; $emailerror=""; echo '

      Comments: '.$commentserror.'

'; } // End of if statement which checks for Display. Once e-mail has been sent there is no need to display contact us form again. ?>