Quantcast
Channel: Struggling with recaptcha v2 and form submission - Stack Overflow
Browsing latest articles
Browse All 8 View Live

Answer by Ariful Haque for Struggling with recaptcha v2 and form submission

If you want to use Curl PHP for getting response, you can use the following code: if(isset($_POST['submit'])){ $privatekey = "paste_your_privatekey"; $responseKey = $_POST["g-recaptcha-response"];...

View Article



Answer by Surya for Struggling with recaptcha v2 and form submission

I prefer the cURL example to the file_get_contents as it gives more options for error logging and such. Some find cURL quite daunting though. For those users Guzzle is a very good alternative.

View Article

Answer by Paul Ishak for Struggling with recaptcha v2 and form submission

First off, the answers already given here are absolutely adequate. That being said, I just wanted to include this function that wraps those answers into a slightly more convenient method, that way you...

View Article

Answer by Peter for Struggling with recaptcha v2 and form submission

Using curl instead of file_get_contents (should you, like me, want file_get_contents to be disabled in the server settings) $post_data = "secret=__your_secret_key__&response="....

View Article

Answer by Alan Kael Ball for Struggling with recaptcha v2 and form submission

I found that sometimes, depending on the PHP version/config, accessing an object directly won't work, so use json_decode(). /* $response object returned from...

View Article


Answer by Elshan for Struggling with recaptcha v2 and form submission

Paste this snippet before the closing tag on your HTML template: <script src='https://www.google.com/recaptcha/api.js'></script> Paste this snippet at the end of the where you want the...

View Article

Answer by random for Struggling with recaptcha v2 and form submission

if (response == true) { mail(); } else { echo "error"; }

View Article

Struggling with recaptcha v2 and form submission

https://developers.google.com/recaptcha/docs/verify if(isset($_POST['submit'])){ $recaptchaResponse = $_POST['g-recaptcha-response']; $secretKey = 'MYKEY'; $request =...

View Article

Browsing latest articles
Browse All 8 View Live




Latest Images