PHP Classes

File: examples/captcha/example1.php

Recommend this page to a friend!
  Classes of Haseeb Ahmad Basil   PHP Skeleton Framework   examples/captcha/example1.php   Download  
File: examples/captcha/example1.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Skeleton Framework
Extensive Web application development framework
Author: By
Last change:
Date: 8 years ago
Size: 693 bytes
 

Contents

Class file image Download
<?php
include 'config.php';
include
'../../A/autoload.php';
$session = new A_Session();
$session->start();

?>
<html>
<head>
</head>
<body>
    <form action="" method="post">
<?php

$request
= new A_Http_Request();

$captcha = new A_Rule_Captcha('captcha', 'Captcha error.', null, $session);

# was there a reCAPTCHA response?
if (! $captcha->isValid($request)) {
    echo
$captcha->getErrorMsg();
} else {
    echo
"Captcha is valid.";
}
echo
$captcha->render();
?>
Type the code:
    <input type="text" name="captcha" value="" size="10"/>
    <br/>
    <input type="submit" value="submit" />
    </form>
</body>
</html>
<?php
dump
($session, 'SESSSION: ');
?>