Enquiry form
Submission of this form assumes you have read and agree with our Privacy Statement.
Fields marked with an * are mandatory. If you are using access keys, [F] will take you the first field on the form and [E] to the enquiry details field.
'; } if (($telnum == 'telephone') || (trim($telnum) == '')) { $block = $block.' A phone number is required.'; } if (($email != 'email address') || (trim($email) == '')){ $email_pattern = '/^((".+")|(\w+([\.-]?\w+)*))@\w+([\.-]?\w+)*(\.\w{2,6})+$/'; if (!preg_match($email_pattern, $email)) { $block = $block.' The email address is not a valid format.
'; } else { $validemail = true; } } // Check security code for auto-filling. if( $_SESSION['security_code'] == $_POST['security_code'] && !empty($_SESSION['security_code'] ) ) { unset($_SESSION['security_code']); } else { $block .= ' You have not entered a valid security code.'; } if ($block == '') { // Compile form info into email for sending. // Send and redirect to thank you page. $mailto = 'siteadmin@1ontheweb.net'; if ($validemail) { $mailfrom = $email; } else { $mailfrom = 'enquiry@1ontheweb.net'; } $subject = 'Web site enquiry'; $mailmsg = 'Opt in: '.$optin."\r\n"; $mailmsg = $mailmsg.$name."\r\n"; if ($_POST['Address1'] != 'first line of address') { $mailmsg = $mailmsg.'Address: '.$_POST['Address1']."\r\n"; } if (!$_POST['Address2'] == 'second line') { $mailmsg = $mailmsg.$_POST['Address2']."\r\n"; } if (!$_POST['Address3'] == 'third line') { $mailmsg = $mailmsg.$_POST['Address3']."\r\n"; } if (!$_POST['PostCode'] == 'postcode') { $mailmsg = $mailmsg.$_POST['PostCode']."\r\n"; } $mailmsg = $mailmsg."\r\n".$telnum."\r\n"; if (!($_POST['Enquiry'] == 'how can we help?')) { $mailmsg = $mailmsg.$_POST['Enquiry']; } mail ($mailto, $subject, $mailmsg, 'From: '.$mailfrom); header('Location: http://1ontheweb.net/thankyou.html'); } else { // Print the error block and represent page. $block = '
Please correct the following:
'.$block.'