Jump to content

Cache problem with gd


Gruzin

Recommended Posts

Hey guys,

 

Here is my problem:

 

I have a security script which generates images with random numbers (everything works fine), and when the registration is finished user gets redirected back to the same register.php and the image doesn't reload (change). I've tryed almost everything but without any luck :(

 

here is a part of my code:

 

// security code
$ivalfrom =ord("a");
$ivalto =ord("z");

for($i=$ivalfrom; $i<=$ivalto; $i++){
$arralpha[] = chr($i);
}

$rand_al = array_rand ($arralpha, 3);
$strrandom = $arralpha[$rand_al[0]] . $arralpha[$rand_al[1]] . $arralpha[$rand_al[3]];
$numpart=mt_rand(10,99);
$strrandom .= $numpart;

//header ("Content-type: image/png");
$img_handle = imagecreate (50, 20) or die ("Cannot Create image"); 
$back_color = imagecolorallocate ($img_handle, 255, 255, 255); 
$txt_color = imagecolorallocate ($img_handle, 233, 114, 191);
$col = imagecolorallocate($img_handle, 220, 220, 220);
for($j=0; $j<=50; $j=$j+5){
imageline($img_handle, $j, 20, $j, 0, $col);
}
imagestring ($img_handle, 31, 7, 2,  $strrandom, $txt_color);
imagepng ($img_handle,"code.png") or die("Cannot save image");
// end security code

 

 

Thanks for reading,

George

 

Link to comment
https://forums.phpfreaks.com/topic/45577-cache-problem-with-gd/
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.