Skip to content

Instantly share code, notes, and snippets.

@duroe5698
Created February 3, 2017 15:22
Show Gist options
  • Save duroe5698/fb75313a4706b2bcdcd6ede177972147 to your computer and use it in GitHub Desktop.
Save duroe5698/fb75313a4706b2bcdcd6ede177972147 to your computer and use it in GitHub Desktop.
Google re-Captcha PHP validation check
<?php
$secret = 'YOURSECRETKEY';
$response=$_POST["g-recaptcha-response"];
$verify=file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret={$secret}&response={$response}");
$captcha_success=json_decode($verify);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment