PHP Classes

File: example-color.php

Recommend this page to a friend!
  Classes of Nguyen Duc Thuan   Named Buttons Captcha   example-color.php   Download  
File: example-color.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Named Buttons Captcha
Show a CAPTCHA image with validation questions
Author: By
Last change:
Date: 11 years ago
Size: 1,196 bytes


Class file image Download
<!DOCTYPE html>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <form method="post"><div>
require 'lib/NamedButtonsCaptcha.php';

$captcha = new NamedButtonsCaptcha();
$captcha->setKeyStorage(new NamedButtonsCaptcha_KeyStorage_Session())
setBackgroundColor(array(250, 250, 250))
setFontColor(array(0, 0, 255));
                if (
$values = isset($_POST['nbc']) ? $_POST['nbc'] : array();
                    if (
$captcha->isValid($values)) {
'<div style="color:green">Verification succeeded</div>';
                    } else {
'<div style="color:red">Verification failed</div>';

<br />
                <br />
                <input type="submit" value="Verify" />