PHP Classes

File: example.php

Recommend this page to a friend!
  Packages of Abdelkader Elkalidi   Easy Recaptcha   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example
Class: Easy Recaptcha
Validate human users with Recaptcha
Author: By
Last change: API key
Date: 15 years ago
Size: 479 bytes
 

 

Contents

Class file image Download
<form method="post" action="">
<?php
    include('recaptcha.class.php');
    
    $captcha    =    new Recaptcha;
    $captcha->publicKey        =    "your public API key";
    $captcha->privateKey    =    "your private API key";

    if(isset($_POST) AND !empty($_POST)){
        $captcha->checkCaptcha();
        $debug    =    $captcha->getError();    
        if(!$debug){
            echo 'All right';
        }
        else{
            echo $debug;
        }
    }
    
    echo $captcha->getCaptcha();
?>
<input type="submit" value="Check captcha" />
</form>