/** * Template Name: Contact Form */ include(TEMPLATEPATH."/demo/recaptchalib.php"); $flag = false; $captcha_flag = false; // Get a key from https://www.google.com/recaptcha/admin/create $publickey = "6LdptuQSAAAAABqTqQatlJNQl8q-pNLTMpfd7ic5"; $privatekey = "6LdptuQSAAAAAIABscImroFQLyvIInPIcyCPQCGl"; # the response from reCAPTCHA $resp = null; # the error code from reCAPTCHA, if any $error = null; if ($_POST["recaptcha_response_field"]) { $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); if ($resp->is_valid) { $captcha_flag = true; } else { $captcha_flag = false; } } ?>