?php // Check if form was submitted:
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['recaptcha_response'])) {
// Build POST request:
$recaptcha_url = 'https://www.google.com/recaptcha/api/siteverify';
$recaptcha_secret = '6Lfn1qAUAAAAAL--CZyVREkT8vgpeLeGTBhOQtB8';
$recaptcha_response = $_POST['recaptcha_response'];
// Make and decode POST request:
$recaptcha = file_get_contents($recaptcha_url . '?secret=' . $recaptcha_secret . '&response=' . $recaptcha_response);
$recaptcha = json_decode($recaptcha);
// Take action based on the score returned:
if ($recaptcha->score >= 0.5) {
// Verified - send email
} else {
// Not verified - show form error
}
}
?>
Interdom Mallorca S.L. - Avenida Rey Jaime I, 109 - E-07180 Santa Ponsa
Tel. +34 971 69 90 62 - Fax. +34 971 69 90 48
E-Mail: info@interdom-mallorca.com Impressum