Paldo Posted June 8, 2009 Share Posted June 8, 2009 Hello everyone! I 'm learning how to create captcha so I decided to follow one tutorial on youtube. After only a few rows of code the first checkpoint should be showing a small black image, at least at the tutorial it works, but when I try it it in FireFox it says in my native language: Picture "http://www.parobek.euweb.cz/captcha.php" can not be wieved becouse it contains mistakes. In I Explorer it prints : ‰PNG IHDRP4!ćIDATX…íÁ€ţŻî j>*ÖĽIEND®B`‚ I checked the code is the same as the guy use in his tutorial... What could be a problem? Thanks for your help. <html> <body> <?php $img = imagecreatetruecolor(80, 30); $white = imagecolorallocate($img, 255, 255, 255); $black = imagecolorallocate($img, 0, 0, 0); $red = imagecolorallocate($img, 255, 0, 0); $pink = imagecolorallocate($img, 200, 0, 150); imagefill($img, 0, 0, $black); header("Content-type: image/png"); imagepng($img); imagedestroy($img); ?> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/161423-solved-image-create-problem-please-help/ Share on other sites More sharing options...
Alex Posted June 8, 2009 Share Posted June 8, 2009 You shouldn't be printing out any html or white space. Quote Link to comment https://forums.phpfreaks.com/topic/161423-solved-image-create-problem-please-help/#findComment-851877 Share on other sites More sharing options...
alco19357 Posted June 8, 2009 Share Posted June 8, 2009 yes, remove the <html> <body> </body> </html> and also, be careful of IE, it has trouble with png sometimes Quote Link to comment https://forums.phpfreaks.com/topic/161423-solved-image-create-problem-please-help/#findComment-851880 Share on other sites More sharing options...
Paldo Posted June 8, 2009 Author Share Posted June 8, 2009 Thanks a lot. That worked... Quote Link to comment https://forums.phpfreaks.com/topic/161423-solved-image-create-problem-please-help/#findComment-851889 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.