)/i", $_POST['comments'])) $points += 2; if (strlen($_POST['name']) < 3) $points += 1; if (strlen($_POST['telephone1']) < 10 || strlen($_POST['telephone1'] > 15)) $points += 2; if (strlen($_POST['comments']) < 15 || strlen($_POST['comments'] > 1500)) $points += 2; if (preg_match("/[bcdfghjklmnpqrstvwxyz]{7,}/i", $_POST['comments'])) $points += 1; // end score assignments foreach($requiredFields as $field) { trim($_POST[$field]); if (!isset($_POST[$field]) || empty($_POST[$field]) && array_pop($error_msg) != "Please fill in all the required fields and submit again.\r\n") $error_msg[] = "Please fill in all the required fields and submit again."; } if (!empty($_POST['name']) && !preg_match("/^[a-zA-Z-'\s]*$/", stripslashes($_POST['name']))) $error_msg[] = "The name field must not contain special characters.\r\n"; if (!empty($_POST['email']) && !preg_match('/^([a-z0-9])(([-a-z0-9._])*([a-z0-9]))*\@([a-z0-9])(([a-z0-9-])*([a-z0-9]))+' . '(\.([a-z0-9])([-a-z0-9_-])?([a-z0-9])+)+$/i', strtolower($_POST['email']))) $error_msg[] = "That is not a valid e-mail address.\r\n"; if (!empty($_POST['url']) && !preg_match('/^(http|https):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(:(\d+))?\/?/i', $_POST['url'])) $error_msg[] = "Invalid website url.\r\n"; if ($error_msg == NULL && $points <= $maxPoints) { $subject = "Boltby Trekking Website Message Form"; $message = "Boltby Trekking website form message : \n\n"; foreach ($_POST as $key => $val) { if (is_array($val)) { foreach ($val as $subval) { $message .= ucwords($key) . ": " . clean($subval) . "\r\n"; } } else { $message .= ucwords($key) . ": " . clean($val) . "\r\n"; } } $message .= "\r\n"; // $message .= 'IP: '.$_SERVER['REMOTE_ADDR']."\r\n"; // $message .= 'Browser: '.$_SERVER['HTTP_USER_AGENT']."\r\n"; // $message .= 'Points: '.$points; if (strstr($_SERVER['SERVER_SOFTWARE'], "Win")) { $headers = "From: $yourEmail\n"; $headers .= "Reply-To: {$_POST['email']}"; } else { $headers = "From: $yourWebsite <$yourEmail>\n"; $headers .= "Reply-To: {$_POST['email']}\r\n"; // $headers .= "Bcc: test@royall.co.uk\r\n"; } if (mail($yourEmail,$subject,$message,$headers)) { if (!empty($thanksPage)) { header("Location: $thanksPage"); exit; } else { $result = 'Your mail was successfully sent.'; $disable = true; } } else { $error_msg[] = 'Your mail could not be sent this time. ['.$points.']'; } } else { if (empty($error_msg)) $error_msg[] = 'Your mail looks too much like spam, and could not be sent this time. ['.$points.']'; } } function get_data($var) { if (isset($_POST[$var])) echo htmlspecialchars($_POST[$var]); } ?>
|
||
Boltby Trekking & Trail
Riding Centre
|
|
Riding establishment licence holder - Sheila Ashby - R19 / 3 / Y2We are 7 miles from Thirsk, the
Darrowby of famous vet and author James Herriot. We are in the North York Moors National
Park, 20 miles from the city of York, 10 miles from Helmsley, 20 minutes from A1M jct 49 and
just an hour from Leeds.
East Coast rail services from York
are only 2 hours from London and 3 hours to Edinburgh. Please note some satnav devices seem to have problems finding Boltby! You can contact us by Telephone 01845 537392 or use this form * denotes required field
ERROR: '. implode(" '. $result . " "; } ?> |