/usr/share/doc/php-google-recaptcha/examples
NameSizeModeActions
appengine-https.php20710644editdlrm
config.php.dist18480644editdlrm
examples.css4030644editdlrm
google0afd8760fd68f119.html530644editdlrm
index.php38020644editdlrm
recaptcha-content-security-policy.php85640644editdlrm
recaptcha-v2-checkbox-explicit.php79450644editdlrm
recaptcha-v2-checkbox.php75080644editdlrm
recaptcha-v2-invisible.php72570644editdlrm
recaptcha-v3-request-scores.php68020644editdlrm
recaptcha-v3-verify.php28710644editdlrm
robots.txt240644editdlrm
Edit: /usr/share/doc/php-google-recaptcha/examples/recaptcha-v2-checkbox-explicit.php (7945B)
reCAPTCHA demo - "I'm not a robot" checkbox - Explicit render

reCAPTCHA demo

"I'm not a robot" checkbox - Explicit render

↩️ Home

Add your keys

If you do not have keys already then visit https://www.google.com/recaptcha/admin to generate them. Edit this file and set the respective keys in the config.php file or directly to $siteKey and $secret. Reload the page after this.

POST data

setExpectedHostname($_SERVER['SERVER_NAME']) ->verify($_POST['g-recaptcha-response'], $_SERVER['REMOTE_ADDR']); if ($resp->isSuccess()): // If the response is a success, that's it! ?>

Success!

That's it. Everything is working. Go integrate this into your real project.

⤴️ Try again

Something went wrong

Check the error code reference at https://developers.google.com/recaptcha/docs/verify#error-code-reference.

Note: Error code missing-input-response may mean the user just didn't complete the reCAPTCHA.

⤴️ Try again

Complete the reCAPTCHA then submit the form.

An example form