Problem s nacitavanim
1 příspěvek
Archiv diskusního fóra
Fórum je uzavřené a slouží pouze ke čtení. Některé informace mohou být zastaralé.
-
Zdravim! Mam script, ktory mi generuje obrazok! Problem je v tom, ze strasne moc dlho trva kym mi ho nacita! Ale ked odstranim session_start (); tak mi to funguje hned! Ale to session_start (); tam musi byt, lebo potrebujem pouzivat session! Neviem jak nato, ci netreba nieco nastavit ci co! Za help dopredu dik! Moj script: <?php session_start (); $obrazok = imagecreatefrompng("a.png"); for ($i=0;$i<5;$i++) { while(strlen($str)!=1) { $random=rand(48,122); if( ($random>47 && $random<58) || ($random>96 && $random<123) || ($random>64 && $random<91) ) { $str.=chr($random); } } $text .= $str; $textcolor = imagecolorallocate($obrazok,rand(0,130),rand(0,130),rand(0,130)); imagettftext ($obrazok,rand(15,25),rand(-45,45),15+($i*38),35, $textcolor,"arial.ttf",$str) ; $str = NULL; } $_SESSION["str"] = $text; header("Content-type: image/png"); imagepng($obrazok); imagedestroy ($obrazok); ?>