Login   Register  
PHP Classes
elePHPant
Icontem

File: readme.txt

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of pugliese fabrizio  >  DF_Captcha  >  readme.txt  >  Download  
File: readme.txt
Role: Documentation
Content type: text/plain
Description: Readme - how use this class
Class: DF_Captcha
Generate images for CAPTCHA validation
Author: By
Last change: add nb
Date: 2008-05-10 06:28
Size: 2,428 bytes
 

Contents

Class file image Download
#################################################
#                                               # 
#   class DF_Captcha for one simple captcha     #
#                                               #
#   License : GPL                               #
#                                               # 
#################################################

This is a class for a one captcha!
You can tell me: "Oneother captcha script?"
I saw you: "This is more simple!"

NB: this class 4 work need sans.ttf; if you hate it, you can change with what you want. But remenber you must change the param text_font;

This class give you a simple captcha, without the need to save the image on your server!
You can have a captcha in only 3 instruction:

1: $c = new DF_Captcha(372, 60, "fff");   #define a new instancies of class => you can define a new class without arg
                                          #es: new DF_Captcha(); => there is default arg
2: $c->drawImage();                       #draw your image => you have your captcha ready
3: $code = $c->getCode();                 #there is your code for verification

Just simple! What do you want yet?
What? You want to set the length of the code?
You can do it!
$c->setLenCode(7);   #replace 7 with the number you want to set your length code

You can modify this parameters of your choise
You must do only this:

$c->format = $param;

#format of the image; are supported only png or jpeg because use of this captcha is prevalently 4 the web
public  $format = "png";
#distortion image with square - this is because so bot are more difficult see the image and the letter over the image
public  $noise_square = 1;
#distortion image with little line - this is because so bot are more difficult see the image and the letter over the image
public  $noise_granular = 1;
#font with text is writed - for change this you must put ttf in dir with the class 
public  $text_font = "sans.ttf";
#this is not modifible
public  $text_font_size;
#0 text color black - 1(default) text color random
public  $text_color_mode = 1;
#1 fix dimension - 0.7 dimension between 70&100% ...
public  $text_size_mode = 0.8;
#0 no rotation - 10 rotation between -10°&+10° - 20 -20°&+20° ...
public  $text_rotation_mode = 10;                                         
                
That's all!
If the class is OK 4 you, please vote it on phpclasses.org!