Jump to content

Get string printed in image by imagestring


island

Recommended Posts

thanks for replay.

 

Yes, but me i need to find how to get the text on image after when it printed

 

for example :

 

 

	$alphanum = "ABCDEFGHIJKLMNPQRSTUVWXYZ123456789";

$rand = substr(str_shuffle($alphanum), 0, 5);

$_SESSION['image_random_value'] = md5($rand);

$image = imagecreatefromjpeg("img/bg".rand(1,2).".jpg");

$bgColor = imagecolorallocate ($image, 255, 255, 255);

$textColor = imagecolorallocate ($image, 0, 0, 0);

imagestring ($image, 5, 5, 2, $rand, $textColor);

header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");

header('Content-type: image/jpeg');

imagejpeg($image);

imagedestroy($image);

 

This code print a random text in an image and send it to navagator, my question is how to get text printed in image ?

 

Thanks in advance

I will poste my question in other way :

 

a website use this script for doing captcha in form :

 

$_SESSION['image_random_value'] = md5($rand);

$image = imagecreatefromjpeg("img/bg".rand(1,2).".jpg");

$bgColor = imagecolorallocate ($image, 255, 255, 255);

$textColor = imagecolorallocate ($image, 0, 0, 0);

imagestring ($image, 5, 5, 2, $rand, $textColor);

header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");

header('Content-type: image/jpeg');

imagejpeg($image);

imagedestroy($image);

 

 

Is there any way to pass (or break) this captcha ?

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.