PHP Classes

File: OspamNo_example.php

Recommend this page to a friend!
  Packages of Abdulrahman Muhammad   OspamNo   OspamNo_example.php   Download  
File: OspamNo_example.php
Role: Example script
Content type: text/plain
Description: example
Class: OspamNo
CATCHA validation spelling math expressions
Author: By
Last change: changed to be more beauty and work with last change in class
Date: 18 years ago
Size: 649 bytes
 

Contents

Class file image Download
<?php 
//
//example for OspamNo
//

require ('OspamNo.php');

$OspamNo = new OspamNo('en'); // en or ar


switch ($_GET['go']) 
{
    default:
    case 1:
    
        echo '
        <form action="?go=2" method="post">
            Answer to pass:<br/>
            ' . $OspamNo->show() . ' <br/>
            <input type="text" name="answer" size="10" /> <br/>
            <input type="submit" value="go" />
        </form>';
        
    break;
    case 2:

        if (empty($_POST['answer'])) 
        { 
            echo "answer is an empty !!"; 
            exit();
        }

        if ($OspamNo->result($_POST['answer']))
        {
            echo "Good answer :)";
        }
        else
        {
            echo "Bad answer !!! :(";
        }

    break;

}

?>