WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search


Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - השוואת מחירים בסופר
ZeroLag.com
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Generate image with random number (CAPTCHA)
Categories : PHP, GD image library, Graphics, Security Click here to Update Your Picture
Ben Yacoub Hatem
Date : Jun 13th 2004
Grade : 2 of 5 (graded 14 times)
Viewed : 22673
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Ben Yacoub Hatem
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 



imgsecuregen() Generate an image with a random number, usefull for bot protection.

@param integer $size
@author Ben Yacoub Hatem <[email protected]>
@copyright Copyright PHP Tunisie (c) 2004
@version $Id$ - 12/06/2004 07:02:09 - securelogin.php
@access public
@return

<?php
function imgsecuregen($size = 6){
     
   
$width = 11*$size;
   
$height = 30;
     
   
$string = "";
    for(
$i = 1; $i <= $size; $i++){
       
$string .= rand (0,9)."";
    }
// for
     
   
$im = ImageCreate($width, $height);
   
$bg = imagecolorallocate($im, 255, 255, 255);
   
$black = imagecolorallocate($im, 0, 0, 0);
   
$grey = imagecolorallocate($im, 170, 170, 170);
   
imagerectangle($im,0, 0, $width-1, $height-1, $grey);   
   
imagestring($im, 5, $size, 5, $string, $black);
   
imagepng($im);
   
imagedestroy($im);
}

imgsecuregen(10);

?>




A captcha image allows you to prevent spam posting when users reload the page and stop bots from submitting forms automatically. This version allows you to use your own fonts (.ttf) to show the text.
Categories : PHP, Security, Graphics, GD image library
A damaged image generator (class) for validating text. CAPTCHA - Completely Automated Public Turing test to tell Computers and Humans Apart
Categories : PHP, PHP Classes, Security, GD image library, Security
CAPTCHA[Image verification]
Categories : PHP, Security, GD image library, Graphics, Sessions
Random Number generation using PHP's GD technique (captcha).
Categories : PHP, GD image library, Graphics, Security
Dynamic Image Authentication System in Signup Pages (CAPTCHA)
Categories : PHP, Security, GD image library
EasyPhpThumbnail Class - The EasyPhpThumbnail class allows you to generate thumbnails and handle image manipulation for GIF, JPG and PNG on-the-fly.
Categories : PHP, PHP Classes, Object Oriented, Graphics, GD image library
Simple PHP Bar Graph using GD library
Categories : PHP, GD image library, Graphics, Arrays
Add a text description to an image. The text is not created over the image but rather creates a new, higher image. The upper part is the original image and the lower is the text. Text is wrapped at the end of line, the number of rows is adjustable.
Categories : PHP, GD image library, Graphics
PHP Image Compression using GD library
Categories : PHP, Compression, GD image library, Graphics
Function to generate readable/remeberable random password
Categories : PHP, Security, Security
Display a bar chart based on random values.
Categories : Graphics, PHP, GD image library, Charts and Graphs
Advanced Image WaterMarker
Categories : PHP, PHP Classes, GD image library, Graphics, Object Oriented
Securing Web Forms with Simple PHP-CAPTCHA (Completely Automated Public Turing test to tell Computers and Humans Apart)
Categories : PHP, Security, GD image library, Sessions
crop and resize image class using gd library function
Categories : PHP, PHP Classes, GD image library, Graphics
Line graphics generation library written in PHP + GD library (spanish comments)
Categories : PHP, Graphics, GD image library