function createImage(){
// creates the images, writes the file
$fileRand = md5(rand(100000,999999));
$string_a = array("A","B","C","D","E","F","G","H","J","K",
"L","M","N","P","R","S","T","U","V","W","X","Y","Z",
"2","3","4","5","6","7","8","9");
$keys = array_rand($string_a, 6);
foreach($keys as $n=>$v){
$string .= $string_a[$v];
}
$backgroundimage = "security_background.gif";
$im=imagecreatefromgif($backgroundimage);
$colour = imagecolorallocate($im, rand(0,255), rand(0,255), rand(0,255));
$font = 'Arial';
$angle = rand(-5,5);
// Add the text
imagettftext($im, 16, $angle, 15, 25, $colour, $font, $string);
$outfile= "$fileRand.gif";
imagegif($im,$outfile);
return $outfile;
}
//code for image display
echo "";
?>
[Wednesday, January 09, 2008
|
0
comments
]
Popular Posts
- Creating Custom Module in VtigerCRM
- Contact Me
- Creating Google map and adding markers ans polyline on it
- Help with codeignitor
- Adding cronjobs in Linux using SSH
- Add/Remove text control using javascript
- Pagination Class in PHP
- function to check whether the year given is a leap year or not
- Random password generation :using ajax and jquery
- function to validate the a given credit card based on the card type and based on luhns algorithm
0 comments
Post a Comment
Please put your comments here. your questions, your suggestions, also what went wrong with me.