//Form Vars if ($_POST['exe']=="yes"){ //Lets check our captcha word if ($word!="bilec"){ $captcha = "false"; $error = "true"; } //Are any brochures selected? if ($b1=="" && $b2=="" && $b3=="" && $b4=="" && $b5=="" && $b6=="" && $b7==""){ $error = "true"; } //Validate email address if (!ereg("^[a-z0-9_-]+[a-z0-9_.-]*@[a-z0-9_-]+[a-z0-9_.-]*\.[a-z]{2,5}$", $email)) { // Email invalid because wrong number of characters in one section, or wrong number of @ symbols. $error = "true"; $email_verify = "invalid"; } //Are all fields completed? if ($fname=="" || $lname=="" || $house=="" || $street=="" || $town=="" || $postcode=="" || $purchase_period=="" || $email=="" || $telephone=="" || $word=="") { $error = "true"; } //Lets process the email if no errors are present if ($error!="true"){ //Email address where form is from $email = $email; $admin = 'sales@ryternadoors.co.uk'; //Define form variables here $today = date("d/m/Y"); $subject = "Ryterna Brochure Request"; $goenquiry = "Date: $today\n\n" . "Please send brochures to:\n\n" . "Name: $fname $lname\n" . "Address: $house $street, $town, $postcode\n" . "Email: $email\n" . "Tel: $telephone\n" . "Purchase Time: $purchase_period\n\n" . "Brochures Requested:\n" . "1. $b1\n" . "2. $b2\n" . "3. $b3\n" . "4. $b4\n" . "5. $b5\n" . "6. $b6\n" . "7. $b7\n\n" . "/// END OF REQUEST\n\n" . "This email was automatically generated from the RYTERNA website.\n\n" ; mail($admin, $subject, $goenquiry, "From: $email" ); header( "Location: /contact/thankyou.php" ); } } ?>