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

Link to comment
Share on other sites

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 ?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.