$value) { // assign to temporary variable and strip whitespace if not an array $temp = is_array($value) ? $value : trim($value); // if empty and required, add to $missing array if (empty($temp) && in_array($key, $required)) { array_push($missing, $key); } // otherwise, assign to a variable of the same name as $key elseif (in_array($key, $expected)) { ${$key} = $temp; } } } // validate the email address if (!empty($email)) { // regex to ensure no illegal characters in email address $checkEmail = '/^[^@]+@[^\s\r\n\'";,@%]+$/'; // reject the email address if it doesn't match if (!preg_match($checkEmail, $email)) { array_push($missing, 'email'); } } // go ahead only if not suspect and all required fields OK if (!$suspect && empty($missing)) { // set default values for variables that might not exist // build the message $message = "Name: $name\n\n"; $message .= "Email: $email\n\n"; $message .= "Telephone: $telephone\n\n"; $message .= "Comments: $comments\n\n"; $message .= "How did you find us?: $howfound\n\n"; // limit line length to 60 characters $message = wordwrap($message, 60); // create additional headers $additionalHeaders = 'From: David at Chelston Nurseries'; if (!empty($email)) { $additionalHeaders .= "\r\nReply-To: $email"; } // send it $mailSent = mail($to, $subject, $message, $additionalHeaders); if ($mailSent) { // $missing is no longer needed if the email is sent, so unset it unset($missing); } } } ?> Garden Centre Plant Nurseries Taunton Somerset Wellington Devon

 

Contact Chelston Nurseries

 

Please complete the missing item(s) indicated.

Sorry, there was a problem sending your message. Please try again.

Thank You. Your message has been sent and we will get back to you shortly....

Please use the form below to request a quote or for further information on any of our services.

/>
/>
/>

 

 

 

logo for the Horticultural Trades Association

 

We are a Member of The Horticultural Trades Association

 

 

Opening Times:

Our opening times are:

Mon to Sat – 9.00 – 5.30

Sunday – 10.00 – 4.00

(Closed Sundays in Aug)

Telephone:

01823 662007

 

About | Nursery | Plant List | Map | Contact | History

All material is Copyright ©2013 Spotlight Web Designs