PHP Classes

File: example_handler.php

Recommend this page to a friend!
  Classes of ~~   RainCaptcha   example_handler.php   Download  
File: example_handler.php
Role: Example script
Content type: text/plain
Description: Example
Class: RainCaptcha
Validate CAPTCHA images with RainCaptcha
Author: By
Last change:
Date: 11 years ago
Size: 630 bytes
 

Contents

Class file image Download
<html>
    <body>
        <?php
           
require_once('RainCaptcha.class.php');
           
$captcha = new RainCaptcha();

            if(isset(
$_REQUEST['captcha'])) {
               
$isCaptchaCorrect = $captcha->checkAnswer($_REQUEST['captcha']);

                if(
$isCaptchaCorrect) {
                    echo
'You have entered <strong>correct</strong> CAPTCHA code!';
                }
                else {
                    echo
'You have entered <strong>wrong</strong> CAPTCHA code! <a href="example_form.php">Please try again!</a>';
                }
            }
       
?>
</body>
</html>