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 Kacper Rowinski  >  OneClickCaptcha  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example script
Class: OneClickCaptcha
CAPTCHA validation based on user clicks on circles
Author: By
Last change:
Date: 1 year ago
Size: 611 bytes
 

Contents

Class file image Download
<?php
# Sample of usage OneClickCaptcha
include('oneClickCaptcha.php');


$oneClickCaptcha = new oneClickCaptcha();

// simple demonstration!
$request = isset($_GET['get_captcha']) ? $_GET['get_captcha'] : '';
if (
$request === 'true')
{
    
$oneClickCaptcha->GenerateCaptchaImg();
}
else if (
true == $oneClickCaptcha->Validate())
{
    echo 
'<h3>You are human!!</h3>';
}
else
{
    echo 
'<h3>Wrong!</h3>';
}

// this is all html you need to validate captcha
echo '
<form action="example.php" method="POST">
    <input type="image" src="example.php?get_captcha=true" name="position[]"/>
</form>
'
;