Jump to content

Add lines to small CAPTCHA


codeboy89

Recommended Posts

I am still learning PHP and understand adding lines to an extent. But I am not sure how I would go about adding lines to a image thats so small. Can anyone show me how it can be done or adding noise just to make it a little harder.

 

<?

session_start();

 

$cap = rand(100, 999);

$_SESSION['captcha'] = $cap;

 

$img = ImageCreate(25,11);

$bg = ImageColorAllocate($img,255,255,255);

$txt = ImageColorAllocate($img,0,102,153);

 

ImageFill($img,0,0,$bg);

ImageString($img,3,0,0,$cap,$txt);

 

header('Cache-control: private, no-cache, must-revalidate');

header('Expires: 0');

header("Content-type: image/png");

ImagePNG($img);

ImageDestroy($img);

?>

Link to comment
https://forums.phpfreaks.com/topic/191276-add-lines-to-small-captcha/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.