PHP Classes

File: Readme.txt

Recommend this page to a friend!
  Classes of Ver Pangonilo  >  Simple CAPTCHA  >  Readme.txt  >  Download  
File: Readme.txt
Role: Documentation
Content type: text/plain
Description: Sample True Type Font file
Class: Simple CAPTCHA
Generate and verify CAPTCHA validation images
Author: By
Last change: Added note on TTF
Date: 10 years ago
Size: 2,526 bytes


Class file image Download
Projectname:   Simple CAPTCHA class
Version:       0.1
Author:        Ver Pangonilo <>
Last modified: 18 May 2006
Copyright (C): 2006 Ver Pangonilo, All Rights Reserved

   * GNU General Public License (Version 2, June 1991)
   * 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.

   This class can generate CAPTCHAs for user forms. Parameters can be set on the configuration file including transprency.

The font "BRADHITC.TTF" is required for the default configuration. This is a common script font for Windows. A replace the default font to suit application.

Usage :
Create a configuration file which contains the following:






//Background Image
$config['BackgroundImage'] = "white.png";

//Background Color- HEX
$config['BackgroundColor'] = "FFFC00";

//image height - same as background image

//image width - same as background image

//text font size

//text font style

//text angle to the left

//text angle to the right

//Text Color - HEX

//Number of Captcha Code Character

//Background Image Transparency
// 0 - Not Visible, 100 - Fully Visible




//Create a new instance of the captcha
$captcha = new SimpleCaptcha($config);

//Save the code as a session dependent string
$_SESSION['string'] = $captcha->Code;


Save this file as captcha.php or any filename you wish to. In the html form,
the usage will be

<img src="PATH_TO/captcha.php" alt="captcha" width="WIDTH" height="HEIGHT" />

1. Initially, it only uses PNG images.
2. The image size should be the same as the background image size.