Login   Register  
PHP Classes
elePHPant
Icontem

File: img.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Alfred R. Baudisch  >  Forms Validator  >  img.php  >  Download  
File: img.php
Role: Example script
Content type: text/plain
Description: File used on the examples
Class: Forms Validator
CAPTCHA validation of forms using security images
Author: By
Last change:
Date: 2004-07-24 22:37
Size: 1,606 bytes
 

Contents

Class file image Download
<?php
// ---------------------------------------------------------------------------
// Image Validator by Alfred Reinold Baudisch<alfred_baudisch@hotmail.com>
// Copyright © 2003, 2004 AuriumSoft - www.auriumsoft.com.br
// ---------------------------------------------------------------------------
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
// ---------------------------------------------------------------------------

// You must start sessions in the page you'll use the image validator!
session_start();

require 
"class.img_validator.php";

if(isset(
$_GET["words"]))
{
    
$words = array(
        
"Computer""PHP5""Internet""OOP""Linux""Slackware""WindowsXP""phpClasses"
    
);

    
srand((double) microtime() * 1000000);

    
$t rand(0count($words)-1);
    
$word $words[$t];
}
else
{
    
$word false;
}

$img = new img_validator();
$img->generates_image($word);
?>