File: img.php

Recommend this page to a friend!
  Classes of Alf-Red  >  Registration  >  img.php  >  Download  
File: img.php
Role: Auxiliary script
Content type: text/plain
Description: create and draw a picture
Class: Registration
User registration with CAPTCHA image validation
Author: By
Last change:
Date: 16 years ago
Size: 2,155 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
// ---------------------------------------------------------------------------
// Change made by Tristan Carron <tc@idiap.ch>
// Date : 2005-03-01
// - Implement a new letters controle
// ---------------------------------------------------------------------------
// 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"]))
{
   
$letter = array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q",
                   
"R", "S", "T", "U", "V", "W", "X", "Y", "Z",
                   
"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q",
                   
"r", "s", "t", "u", "v", "w", "x", "y", "z"
                   
) ;

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

   
$t = rand(0, count($words)-1);
    for(
$i=0 ; $i<rand(5, 10); $i++)
        {
           
$l = rand(0, count($letter)-1);
           
$word .= $letter[$l];
        }
}
else
{
   
$word = false;
}

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

For more information send a message to info at phpclasses dot org.