Skip to content

Instantly share code, notes, and snippets.

Created March 13, 2022 23:21
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Google recaptcha v3 - PHP
if(isset($_POST['g-recaptcha-response']) && !empty($_POST['g-recaptcha-response'])){
$secret_key = 'SECERET_KEY';
$verify_captcha = file_get_contents(''.$secret_key.'&response='.$_POST['g-recaptcha-response']);
$verify_response = json_decode($verify_captcha);
// check the captcha checkbox
// empty captcha
<form method="post" action="check.php">
<script src="" async defer></script>
<div class="g-recaptcha" data-sitekey="SITE_KEY"></div>
<input type="submit" value="Submit">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment