Get in Touch
If you require any more information on Bodycare Clinics, please complete the form below.
All fields marked (*) are required.
';
}
if(empty($email) || filter_var($email, FILTER_VALIDATE_EMAIL) === false){
$valErr .= 'Please enter a valid email.
';
}
if(empty($telephone)){
$valErr .= 'Please enter your telephone number.
';
}
if(empty($message)){
$valErr .= 'Please enter message.
';
}
// Check whether submitted input data is valid
if(empty($valErr)){
// Validate reCAPTCHA response
if(isset($_POST['g-recaptcha-response']) && !empty($_POST['g-recaptcha-response'])){
// Google reCAPTCHA verification API Request
$api_url = 'https://www.google.com/recaptcha/api/siteverify';
$resq_data = array(
'secret' => $secretKey,
'response' => $_POST['g-recaptcha-response'],
'remoteip' => $_SERVER['REMOTE_ADDR']
);
$curlConfig = array(
CURLOPT_URL => $api_url,
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => $resq_data
);
$ch = curl_init();
curl_setopt_array($ch, $curlConfig);
$response = curl_exec($ch);
curl_close($ch);
// Decode JSON data of API response in array
$responseData = json_decode($response);
// If the reCAPTCHA API response is valid
if($responseData->success){
// Send email notification to the site admin
$to = $recipientEmail;
$subject = 'New Contact Request Submitted via Bodycare Clinics website';
$htmlContent = "
Name: ".$name."
Email: ".$email."
Telephone: ".$telephone."
Message: ".$message."
"; // Always set content-type when sending HTML email $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n"; // Sender info header $headers .= 'From:'.$name.' <'.$email.'>' . "\r\n"; // Send email mail($to, $subject, $htmlContent, $headers); $status = 'success'; $statusMsg = 'Thank you! Your contact request has been submitted successfully.'; $postData = ''; }else{ $statusMsg = 'The reCAPTCHA verification failed, please try again.'; } }else{ $statusMsg = 'Something went wrong, please try again.'; } }else{ $valErr = !empty($valErr)?'If you require any more information on Bodycare Clinics, please complete the form below.
All fields marked (*) are required.
Newcastle Office
Q6 Quorum Business Park
Benton Lane
Newcastle upon Tyne
Tyne and Wear
NE12 8BT
Tel: 0333 577 2377