Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes 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: 2011-05-13 20:48
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>