Page 1 of 1

*** SOLVED *** captcha v3 not ever trying to validate

Posted: Tue Jan 18, 2022 5:52 pm
by John_Pittman
Hi,
I have ver17.1.2 of web builder
I have a form that works when the built-in captcha is used.
I went to google and got the v3 keys and entered them in the form for v3 captcha
I save the project and published to website. (https:)
But the submit always goes to the default error page with the go back link.
However all the data gets posted to email and the mysql table I have setup.
I traced the code to were it fails
$recaptcha_valid = false;
if (isset($_POST['g-recaptcha-response']))

This if statement always test as null
I went through all the page code and do not see any missing pieces when compared to google docs on v3

Any idea why this is happening?

Thanks
John Pittman

Re: captcha v3 not ever trying to validate

Posted: Tue Jan 18, 2022 6:06 pm
by Pablo
To be able to help you, I need to see the full code.

Re: captcha v3 not ever trying to validate

Posted: Tue Jan 18, 2022 6:31 pm
by John_Pittman
I guess I could paste the whole index.php....
or would a link to the page work
https://www.txmedasscociates.com
I new to this forum stuff and did not see way to attach a file (is there a doc on using this editor)

Let me know what you want me to do

Re: captcha v3 not ever trying to validate

Posted: Tue Jan 18, 2022 6:35 pm
by Pablo
The URL of the website is not useful in this case, because I cannot view the PHP code.

Please see this FAQ:
viewtopic.php?f=10&t=82134
(this also applies to all your future questions)

Re: captcha v3 not ever trying to validate

Posted: Tue Jan 18, 2022 6:55 pm
by John_Pittman
Sorry,
I have stripped to form only and have on my google drive.
This all generated code from ver 17.1.2
the google keys are for the website I linked before

https://drive.google.com/file/d/1T-cIOn ... sp=sharing

Hope this works for you

Thanks
John Pittman

Re: captcha v3 not ever trying to validate

Posted: Tue Jan 18, 2022 9:14 pm
by Pablo
The form is OK.
However, the response from the Google server indicates that the keys are invalid:

Image

Re: captcha v3 not ever trying to validate

Posted: Tue Jan 18, 2022 9:55 pm
by John_Pittman
I cut and pasted the keys from google developer.

from google page
Label
txmedassociates.com
reCAPTCHA type:v3
reCAPTCHA keys
Use this site key in the HTML code your site serves to users.
****key removed for security****
Use this secret key for communication between your site and reCAPTCHA.
**** key removed for security***

So are the keys backwards ? According to the wording site key to users and secret to reCAPTCHA.
I'll try switching them

John Pitttman

Re: captcha v3 not ever trying to validate

Posted: Tue Jan 18, 2022 10:08 pm
by John_Pittman
OK, I got it to work.
Nothing wrong with code or anything on your side.
When I cut and pasted the key it was 1 character short, missing the 2 on the end.

Sorry for the time this took for such a simple bonehead mistake on my part.

Thanks, problem solved


John Pittman

Re: captcha v3 not ever trying to validate

Posted: Tue Jan 18, 2022 10:13 pm
by BaconFries
I have deleted the keys for security as these are for use only