Generate Image Verification with PHP


Generate Image Verification is usually used to stop brute force attack in web application …

This code show how Generate Image Verification with PHP

<?
$str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO1234567890";
$randkey = substr(str_shuffle($str),0,7);
$image = imagecreatefromjpeg("./image/test.jpg");
$font = 9 ;
$black = imagecolorallocate($image,0,0,0);

$red = imagecolorallocate($image,100,0,0);
$y = (imagesy($image)-imagefontheight($font))/2;
$x = ((imagesx($image))/4);
imagestring($image,$font,$x,$y,$randkey,$black);
$font =3;
imagestring($image,$font,7,$y+20,”www.gunungpring.com”,$red);
header(”Content-type: image/jpeg”);
imagejpeg($image);
imagedestroy($image);

?>

Tags: ,

Leave a Reply




This some posting which are related to this article :
  • How To Make Brute Force Attack
  • Wordpress Plugin You must have
  • ACDSee Replacement
  • How To Print Capture in Windows
  • Yahoo , Google and Clusty Comparison
  • just read related article


    Some random post which may be interesting :
    this article is selected randomly