PHP Google No CAPTCHA reCAPTCHA jQuery Ajax

PHP Google No CAPTCHA reCAPTCHA jQuery Ajax

Today, We want to share with you PHP Google No CAPTCHA reCAPTCHA jQuery Ajax.
In this post we will show you Google No CAPTCHA reCAPTCHA PHP Example, hear for Google Invisible Recaptcha Using Jquery Ajax and PHP we will give you demo and example for implement.
In this post, we will learn about Create a Contact Form with reCAPTCHA V2, AJAX, and PHP with an example.

  How to Get the Current URL with VueJS?

Welcome to the In Pakainfo.com website! You will Step By Step learn web programming, easy and very fun. This website allmost provides you with a complete web programming tutorial presented in an easy-to-follow manner. Each web programming tutorial has all the practical examples with web programming script and screenshots available.Google No CAPTCHA reCAPTCHA PHP Example

Google No CAPTCHA reCAPTCHA PHP

How to register for Google No CAPTCHA Step By step

Step 1 :-

First, we have to create API key, so we have to go https://www.google.com/recaptcha/admin create. Add label and domain register site in google recaptcha admin.

Step 2 :-

We get key and its partner secret key

  AngularJS Insert using PHP MySQLi

Step 3 :-

Add your recaptcha key of google api.js ::

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

Step 4 :-

Add this site key in div data-sitekey=”add-hear”

<div class="g-recaptcha" data-sitekey="add-your-data-site-key"></div>;

Source Code For reCAPTCHA in php with Demo

In this post we will show how to add Google reCAPTCHA in you web site. It is very easy and sefe way to prove they are human not robot.

In this post we will show you how to use register your domain for Google reCAPTCHA and how to get site key and secret key.

Registering and Retrieving Keys for reCAPTCHA

All instraction for register your site Google No CAPTCHA reCAPTCHA.

Google No CAPTCHA reCAPTCHA PHP Code Example

<!doctype html>
<html>
    <head>
        <title>googles recaptcha php code example | pakainfo.com</title>
		<!-- js recaptcha api call -->
		<script src='https://www.google.com/recaptcha/api.js'></script>        
    </head>
    <body>
	<form method="post" action="index.php">
		<!-- add your data site key in div tag -->
		<div class="g-recaptcha" data-sitekey="your-data-site-key"></div>
        <input type="submit" value="Submit" class="btn btn-primary submit" name="submit" />
    </form>
	<!-- end form -->
    </body>
</html>
 
<?php 
// all check for post method call. 
if($_SERVER["REQUEST_METHOD"] === "POST") 
{ 
	//Simple verify captcha code process 
	// add your secret key 
	$google_recaptcha_secret = "your-data-secret-key"; 
	
	// pass secret key in google recaptcha api url 
	$api_response = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$google_recaptcha_secret."&response=".$_POST['g-recaptcha-response']); 
	
	// json decode for data 
	$api_response = json_decode($api_response, true); 
	
	if($api_response["success"] === true) 
	{ 
		// success result 
		echo "Logged In Successfully"; 
	} 
	else 
	{ 
		// not success result 
		echo "You are a robot"; 
	} 
} 
?>

View Demo

  paypal payment Gateway Integration with laravel 5.5 -Paypal checkout Laravel

Leave a Reply

avatar
  Subscribe  
Notify of