How to integrate google reCAPTCHA in PHP

How to integrate google reCAPTCHA in PHP

Googl reCAPTCHA is used to validate form submit in php.It is easy to integrate Google reCAPTCHA in PHP script. Using google reCAPTCHA in PHP users can prove they are human with single click.

They need just a single click to confirm they are not a robot. So, reCAPTCHA used to protect the website from spammers.

Follow the below steps to integrate google reCAPTCHA in PHP


Get reCAPTCHA API keys:

For adding reCAPTCHA to your site, you need to register your site and get reCAPTCHA API keys

Register your site:

Register your site at Google from here –


Get your Site Key:

Site key is used to display the google reCAPTCHA widget.


Get your Secret Key:
Secret key helps authorizes communication between your website and google reCAPTCHA server.


HTML Code:
At first you need to include the google reCAPTCHA API JavaScript library.

<script src=””></script>

Before the Submit button we have placed the Google reCAPTCHA widget div. Modify the data-sitekey attribute value with your Site Key.

PHP Code:
Need to modify Google Secret Key for ($secret).

Add a Comment

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