How to setup the google reCAPTCHA

STEP :-1

Create reCAPTCHA API keys from recaptcha admin.

STEP :-2 [Client Side]

Add the recaptcha api js and render explicit.

Put below code in bottom of page:

function init_google_captcha() {
	if( jQuery('#home-contact-captcha').length>0 ) {
		captcha_home_contact = grecaptcha.render('home-contact-captcha',{
		 'sitekey' : '6LeJTT8UAAAAABjGeM6FpNutjh9_4t5sTixpnpdq',
		 'theme' : 'light'


STEP :-3 [Server Side]

While submit the form you got the post variable with name “g-recaptcha-response”.

For verify the response use the below API_URL.

You have to add the secret, response, remoteip vars with URL and post the data.

-Sample snippet


if( $this->input->post('g-recaptcha-response') ) {
	$recaptcha_response = $this->input->post('g-recaptcha-response');
	$response = file_get_contents("" . $reCAPTCHA_secret_key . "&response=" . $recaptcha_response . "&remoteip=" . $_SERVER['REMOTE_ADDR']);
	$response = json_decode($response);
	if ( isset($response->success) && $response->success == 1 ) {
		//validate successfully.

Ref :


Best Web Development Tutorials For Beginners


W3Schools is optimized for learning, testing, and training. Examples might be simplified to improve reading and basic understanding.


Free tutorials and reference manuals with examples for Kubernetes, Spring JDBC, Java Concurrency, Gerrit, Spring AOP, Spring MVC, Apache Solr, Excel Power View, Sencha Touch, Tex Commands, Agile Testing, Apache Tajo, C++ Library, MariaDB, SAP QM, SAP SOLMAN, SAP SCM, MS Access, KoaJS, OAuth2.0, Scrapy, SAP CCA, SAP PM, SAPUI5, Cognos, Internet of Things, Rural Marketing, Trampolining, Golf, Angular2, Framework7, Arduino, CherryPy, Firebase, SAP C4C, SAP Dashboard, SAP PI, ExpressJS, Design Thinking, Internet Security, PyGTK, Apache Drill, Excel Charts, Elastic Search, Computer Security, Extreme Programming, Behavior Driven Development, Conversion Rate Optimization, SAP Basis, Business Law, Kanban, Erlang, SAP Payroll, ASP.Net WP, PouchDB, MFC, SAP HR, Yii, Clojure, Aurelia, CoffeeScript, CPanel, Laravel, SAP Webi, MS SQL Server, pinterest, Indian Polity, Windows10, Teradata

CSS Tricks

Tips, Tricks, and Techniques on using Cascading Style Sheets.


Codrops is a web design and development blog that publishes articles and tutorials about the latest web trends, techniques and new possibilities.


GitHub is a web-based Git or version control repository and Internet hosting service. It is mostly used for code. It offers all of the distributed version control and source code management functionality of Git as well as adding its own features.

Stack Overflow

Stack Overflow is the largest online community for programmers to learn, share their knowledge, and advance their careers.

Blog at

Up ↑