Google’s New and easy reCaptcha PHP integration

Recently Google introduced the new and improved reCaptcha API called Are you a robot?. I am impressed with the makeover that reCaptcha has got. Its has become simple, user friendly and protects your websites for spammers and robots. This tutorial will show you how new reCaptcha can be setup and integrated into a PHP code.

new recpatcha for humans

Captcha present on most of the websites out there has frustrated users everywhere. Recently many new user friendly captcha solutions have been developed but I think best of them will be the Google’s new reCaptcha. Here is how you can integrate new reCaptcha in PHP.

Click here to create a Google reCaptcha application.

Register your website

Enter your website domain details excluding http or https

Register new website in reCaptcha

reCaptcha Keys

Here are the two keys generated for your domain. Site Key will be used in HTML client side code and Secret Key will be used in your PHP server-side code for communication with Google using API.

Google site and secret key

HTML Code

This contains simple HTML code with reCaptcha snippet. Modify the Google Site Key in below code.

Login box with new reCaptcha API

 

 

 

 

 

 

 

 

 

 

inc.php

Enter reCaptcha secret and site key in this file. Also a function is created to CURL and get reCaptcha response.

 

example.php

This file includes the above HTML code and PHP code to verify reCaptcha response, username and password.

 

Google’s New And Easy ReCaptcha PHP Integration - Www Earlysandwich Com
Google’s New And Easy ReCaptcha PHP Integration - Www Earlysandwich Com
Google’s New and easy reCaptcha PHP integration - www.earlysandwich.com.zip
3.0 KiB
29 Downloads
Details

One Reply to “Google’s New and easy reCaptcha PHP integration”

  1. Api says:

    I see that is recaptcha v2. thanks , nice tutorial 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

scroll to top