Using Google’s new, “I’m Not A Robot”, No CAPTCHA, reCAPTCHA in a CMSB Form (A Tutorial)

8 posts by 5 authors in: Forums > CMS Builder
Last Post: June 18, 2015   (RSS)

By gkornbluth - April 30, 2015 - edited: April 30, 2015

Hi All,

With a lot of help from Greg Thomas and Dave Edis, here’s a tutorial on how to implement the Google’s new, “I’m Not A Robot”, No CAPTCHA, reCAPTCHA in a CMSB Form.

There are 2 viewers attached to this post, and both incorporate the code required to implement reCAPTCHA.

One contains a very simple form, which demonstrates a bare bones implementation.
The other is the Sample User Signup Form that is generated by the Website Membership Plugin. This demonstrates a more complex implementation with more advanced error checking.

The 5 step implementation for both viewers is the same.

1) Log in to https://www.google.com/recaptcha/admin#list
2) Register your web site. (if you want to get alerts from Google if they detect problems with your site, such as misconfiguration errors or an increase in suspicious traffic, leave the “get alerts” checkbox checked.)
3) A Site Key and Secret Key will be generated, copy them to a safe (secret) place.
4) Enter the 2 Keys as noted in the viewer code.
5) Enter your “Server Path” in the load viewer library code at the top of the viewer code.

After you've completed step 5, upload the files to your server and you should be good to go.

Right now there are only a few “Themes” available to change the look of the check box. They are data-theme="dark" and data-theme="light", and are changed in the <div> where you entered your site key.

You can learn more about Google’s No CAPTCHA reCAPTCHA at: https://developers.google.com/recaptcha/

Best,

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

By gregThomas - April 30, 2015

Thanks for the tutorial Jerry! You can see an example of this new system on our sign-up page:

http://www.interactivetools.com/add-ons/login_createAccount.php

You'll need to be logged out to see the captcha at the bottom of the page.

Cheers,

Greg

Greg Thomas







PHP Programmer - interactivetools.com

By In-House-Logic - May 14, 2015

Thank you Jerry, Dave and Greg!

This type of practical and timely tutorial is yet another excellent  value that this team and community offer their users. Would love to see more of these - and presumably see them added to Jerry's book.

Jayme

By Toledoh - June 17, 2015

Has anyone come across the issue of this simply not displaying?  the code seems to be there, just no content?

https://server.toledoh.com/~oryxautomation/test.php

https://server.toledoh.com/~oryxautomation/test2.php

Cheers,

Tim (toledoh.com.au)

By Dave - June 18, 2015

Tim, 

On the first link (test.php) does it make a difference if you drop "async defer" from the script tag? 

<script src='https://www.google.com/recaptcha/api.js' async defer></script>

Dave Edis - Senior Developer
interactivetools.com

By In-House-Logic - June 18, 2015 - edited: June 18, 2015

Hi Tim,

I'm getting the following errors on both links:

ERROR: Invalid domain for site key

But I can see the include in both cases. The second also shows a form.

Jayme

By Toledoh - June 18, 2015 - edited: June 18, 2015

Ahhh.

Probably not letting me run off an ip address...  Thanks Jayme.

https://server.toledoh.com/~oryxautomation/test2.php works fine - same page.  

Cheers,

Tim (toledoh.com.au)