Gruzin Posted April 4, 2007 Share Posted April 4, 2007 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 More sharing options...
Gruzin Posted April 4, 2007 Author Share Posted April 4, 2007 * bump * Link to comment https://forums.phpfreaks.com/topic/45577-cache-problem-with-gd/#findComment-221342 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.