Copyright: 2007 Eugene Orlov Version: 1.0 October 2007 Make sure the path to the library is correct. */ include("captcha/captcha.function.php"); session_start(); // Change this to your real email address: $myemail = 'denisepeters@aol.com'; $spac = " "; // Initialising the $error variable. At the start it is 0. Each field in this form is processed, and if something is wrong (empty input, wrong email address, invalid captcha code, etc) $error is incremented. Form will stop processing if $error is > 0. $error = 0; $name_text = 'Please enter your name'; $name = ''; $email_text = 'Please enter your email'; $email = ''; $memno_text = 'Please enter your member # if any'; $memno = ''; $message_text = 'Please enter your message'; $message = ''; $captcha_text = 'Please tell me you\'re not a spambot
Letters are CAPS'; // This piece of code decides whether to show the form or to process it if (!isset($_POST['action']) || $_POST['action'] != 'submit') { show_form(); die; } // Ok, let's process the form else { // Checking name if (empty($_POST['name'])) { $error .= 1; $name_text = 'Please enter your name'; } else { $error .= 0; $name_text = 'your name'; // Please note, that in 'real life' you have to do something like this with user's data: mysql_real_escape_string(strip_tags(trim($_POST['name']))); $name = strip_tags($_POST['name']); } // Checking email if (empty($_POST['email'])) { $error .= 1; $email_text = 'Please enter your email'; } elseif (!eregi('^[-!#$%&\'*+\\./0-9=?A-Z^_a-z{|}~]+'.'@'.'[-!#$%&\'*+\\/0-9=?A-Z^_a-z{|}~]+\.'.'[-!#$%&\'*+\\./0-9=?A-Z^_a-z{|}~]+$', $_POST['email'])) { $error .= 1; $email_text = 'Please enter correct email address'; $email = strip_tags($_POST['email']); } else { $error .= 0; $email_text = 'your email'; $email = strip_tags($_POST['email']); } // Checking memno if (empty($_POST['memno'])) { $error .= 0; $memno_text = 'Thank you'; } else { $error .= 0; $memno_text = 'your member #'; // Please note, that in 'real life' you have to do something like this with user's data: mysql_real_escape_string(strip_tags(trim($_POST['name']))); $memno = strip_tags($_POST['memno']); } // Checking message if (empty($_POST['message'])) { $error .= 1; $message_text = 'Please enter your message'; } elseif ((strlen($_POST['message']) < 10)) { $error .= 1; $message_text = 'Please enter no less than 10 symbols'; $message = $_POST['message']; } else { $error .= 0; $message_text = 'your message'; $message = $_POST['message']; } // Now let's check The CAPTCHA if (!captcha_verify_word()) { $error .= 1; $captcha_text = 'Wrong image code'; } else { $error .= 0; } // If $error is > 0, we'll show the form again if ($error > 0) { show_form(); die; } else { // If everything is ok, we'll send an email $name = strip_tags(trim($_POST['name'])); $email = strip_tags(trim($_POST['email'])); $memno = strip_tags(trim($_POST['memno'])); $message = wordwrap(strip_tags(trim($_POST['message'])), 70); $messagea = $memno . $spac . $message; //$email = 'From: '.$name.' <'.$email.'>'; $subject = 'Triess special request form!'; mail($myemail, $subject, $messagea,"From: $email","-f$myemail"); //mail($myemail, $subject, $memno, $message, "From: $email","-f$myemail"); echo "Thank you for your message!"; die(); } } // This function shows the form function show_form() { ?> My contact form

Tri-Ess Supporting Membership Online Special Request Form


 
 
 



Please fill in all the fields and press the button below