reCAPTCHA V2 Array Error

Issues related to forms.
GeorgeR
 
 
Posts: 7
Joined: Tue Apr 10, 2018 10:20 pm

reCAPTCHA V2 Array Error

Post by GeorgeR » Sat May 05, 2018 6:59 pm

I created a simple contact form using the built in PHP form processor script and it works works well, no issues at at. Then I decided to add reCAPTCHA V2 to add some spam protection, but not having much success with that. I donwloaded and installed the extension and added reCAPTCHA V2 to my existing form script which was previouly working. Copy and pasted the Site and Secret keys from Google and published the form to the server along with the reCAPTCHA folder. The form (which is php) and reCAPTCHA folders do appear on the server. The form page loads ok in the browser, and the green check mark (not a robot) appears when the box is clicked. However, when the form is sent an error code appears: The reCAPTCHA code is incorrect. Please try again. Error: Array. I had thought that, perhaps, I had not entered the Site and Secret key codes properly, but I repeated that process again several times and repulbished, with the same result. Any idea what might be going on?

User avatar
BaconFries
 
 
Posts: 4150
Joined: Thu Aug 16, 2007 7:32 pm

Re: reCAPTCHA V2 Array Error

Post by BaconFries » Sat May 05, 2018 7:06 pm

When posting it is always best to provide a url so we can view and test for ourselves.

User avatar
Pablo
 
Posts: 14114
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: reCAPTCHA V2 Array Error

Post by Pablo » Sat May 05, 2018 8:41 pm

Maybe thew page has other (conflicting) code?
Or maybe reCaptcha is not part of the form?

Although this extension is not supported (it is provided "AS IS"), it has been extensively tested and it has been successfully used by many other users. So, if it does not work then it's most likely a configuration issue.

GeorgeR
 
 
Posts: 7
Joined: Tue Apr 10, 2018 10:20 pm

Re: reCAPTCHA V2 Array Error

Post by GeorgeR » Sat May 05, 2018 10:30 pm

The form is in a layout grid, so the grid is the form. The only other code is that used for validation, which is javascipt, I believe.

On my Google reCAPTCA admin page there is also a notice from Google: We detected that your site is not verifying reCAPTCHA solutions.

User avatar
Pablo
 
Posts: 14114
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: reCAPTCHA V2 Array Error

Post by Pablo » Sun May 06, 2018 6:45 am

Maybe you have configured the wrong domain in the reCAPTCHA admin page?

GeorgeR
 
 
Posts: 7
Joined: Tue Apr 10, 2018 10:20 pm

Re: reCAPTCHA V2 Array Error

Post by GeorgeR » Sun May 06, 2018 4:40 pm

There is only one domain on my reCAPTCHA admin page. Could it possilby be the version of php? Looking at the admin page from my web host, I see it listed as PHP version ea-php70.

User avatar
Pablo
 
Posts: 14114
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: reCAPTCHA V2 Array Error

Post by Pablo » Sun May 06, 2018 4:51 pm

Yes, this could be related to the PHP version. I think you will need PHP 5.5 or newer.

User avatar
BaconFries
 
 
Posts: 4150
Joined: Thu Aug 16, 2007 7:32 pm

Re: reCAPTCHA V2 Array Error

Post by BaconFries » Sun May 06, 2018 5:15 pm

Did you use the previous version of ReCaptcha? if so then the secret keys cannot be used again, you will need to generate a new set to use. As Pablo ReCaptchav v2 requires PHP5.5 or higher, check with your host to see what version you are using along with a 'New' set of keys and retry.

GeorgeR
 
 
Posts: 7
Joined: Tue Apr 10, 2018 10:20 pm

Re: reCAPTCHA V2 Array Error

Post by GeorgeR » Sun May 06, 2018 8:01 pm

I checked with my web host and discovered that I could actually select the PHP version via a menu on my site admin panel. It was set to PHP 7.0, so just for interest, I reset it to PHP 5.5 and tried again but that also did not work.

I did, in fact, use the same version of reCAPTCHA (same keys I got when I first signed up at at Google). So I deleted that and got new site keys, updated the form with the new keys and republished. However, I still get the same error message, and still set to PHP 5.5.

I'm not quite sure I understand how or if site keys can be resused. If I make some change to the form will new site keys be required each time I republish the form page?

User avatar
Pablo
 
Posts: 14114
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: reCAPTCHA V2 Array Error

Post by Pablo » Sun May 06, 2018 8:38 pm

reCAPTCHA V2 should work fine with PHP7 (and PHP 5.5 or newer).

GeorgeR
 
 
Posts: 7
Joined: Tue Apr 10, 2018 10:20 pm

Re: reCAPTCHA V2 Array Error

Post by GeorgeR » Tue May 08, 2018 4:43 pm

I found some simple test code at: http://qnimate.com/googles-recaptcha-php-code-example/

This is just to confirm that reCAPTCHA is working, it does nothing more than echo if the login is sucessful, or you are a robot. I was always a robot. So, it is likely that there is no problem with the code generated by WYSIWYG webbuilder. There is something else I am doing wrong even though I'm sure Ive entereed the site keys correctly. Be darned if I can figure what it is though, but I"ll keep on plyaing with it.

luishmpaulo
 
 
Posts: 42
Joined: Wed Jan 11, 2012 8:49 pm
Location: Brazil
Contact:

Re: reCAPTCHA V2 Array Error

Post by luishmpaulo » Mon Jul 23, 2018 5:49 pm

Same to me...

I used the reCaptchaV2 on other sites I built and they are working normally, but in recent (newer) sites no longer works!

Message error: The reCAPTCHA code is incorrect. Please try again.(Error: Array)

See: http://econodiesel.com.br/Contato.php

I did everything the same as always, but it doesn't work anymore...

User avatar
Pablo
 
Posts: 14114
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: reCAPTCHA V2 Array Error

Post by Pablo » Mon Jul 23, 2018 6:07 pm

Did you upload all files?
Do you use the latest version of the extension?

There seem to be multiple references to the reCatpcha on the page:
Did you modify the code manually?

Note that the extension has not been updated recently. So, something else must have changed.

sstepun
 
 
Posts: 2
Joined: Thu Aug 16, 2018 2:46 pm

Re: reCAPTCHA V2 Array Error

Post by sstepun » Thu Aug 16, 2018 3:04 pm

I'm also having this same issue. I have done exactly what the demo videos have explained and have the correct domains entered. I am pulling my hair out scouring google trying to find an answer.

I have removed the widget, readded it. I've checked the admin site a million times verifying site and secret keys. This is boggling me.

If I Leave the error page out of the widget I get this error when submitting the form. "The reCAPTCHA code is incorrect. Please try again.(Error: Array)"

I have also recently starting seeing this when I login to the Google reCaptcha admin page. "We detected that your site is not verifying reCAPTCHA solutions. This is required for the proper use of reCAPTCHA on your site. Please see our developer site for more information."

https://www.oddduckdecor.com/Contact.php

User avatar
Pablo
 
Posts: 14114
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: reCAPTCHA V2 Array Error

Post by Pablo » Thu Aug 16, 2018 3:13 pm

The only reason I can think of, is that your keys are invalid.

Please note that I cannot provide support on this extension.
However, I have used it myself more than a hundred times, so I am sure it works.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests