reCaptcha system using Google API and PHP

In most of the website there is a reCaptcha system form the form. The reCaptcha system will support you to change the captcha code b without refreshing the form. It will also enable the audio captcha also. SO in this article I will explain how to create a reCaptcha using PHP and Google API.

reCaptcha system using Goole API and PHP

You can view demo and download the sample file below

Download FileDemo

What you have to do is first you have to get your Public and Private Key of Google reCaptcha API. You can register the API below,

Sign up with your Google account.

How to get Google API key?

Now you will get both Public and Private Key. Replace the $publickey and $privatekey in index.php

//Include reCaptcha liberary
/* Related Tutorials-
// Get a key from
$publickey = "Your-Public-Key";
$privatekey = "Your-Private-Key";

# The response from reCAPTCHA
$resp = null;
# The error code from reCAPTCHA, if any
$error = null;

# Was there a reCAPTCHA response?
if ($_POST["recaptcha_response_field"]) {
        $resp = recaptcha_check_answer ($privatekey,

        if ($resp->is_valid) {
                echo "You got it!";
        } else {
                # Set the error code so that we can display it
                $error = $resp->error;
echo recaptcha_get_html($publickey, $error);

reCaptchaYou can also add the other html form element in the reCaptcha form. This reCaptcha system works using Google API. By using reCaptcha system you can make an user-friendly captcha for your web forms.

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>