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

Issues related to forms.
Post Reply
John_Pittman
 
 
Posts: 10
Joined: Tue Jan 18, 2022 5:38 pm

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

Post 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
User avatar
Pablo
 
Posts: 21579
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: captcha v3 not ever trying to validate

Post by Pablo »

To be able to help you, I need to see the full code.
John_Pittman
 
 
Posts: 10
Joined: Tue Jan 18, 2022 5:38 pm

Re: captcha v3 not ever trying to validate

Post 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
User avatar
Pablo
 
Posts: 21579
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: captcha v3 not ever trying to validate

Post 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)
John_Pittman
 
 
Posts: 10
Joined: Tue Jan 18, 2022 5:38 pm

Re: captcha v3 not ever trying to validate

Post 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
User avatar
Pablo
 
Posts: 21579
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: captcha v3 not ever trying to validate

Post by Pablo »

The form is OK.
However, the response from the Google server indicates that the keys are invalid:

Image
John_Pittman
 
 
Posts: 10
Joined: Tue Jan 18, 2022 5:38 pm

Re: captcha v3 not ever trying to validate

Post 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
John_Pittman
 
 
Posts: 10
Joined: Tue Jan 18, 2022 5:38 pm

Re: captcha v3 not ever trying to validate

Post 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
User avatar
BaconFries
 
 
Posts: 5328
Joined: Thu Aug 16, 2007 7:32 pm

Re: captcha v3 not ever trying to validate

Post by BaconFries »

I have deleted the keys for security as these are for use only
Post Reply