Jump to content

[SOLVED] Image create problem. Please Help


Paldo

Recommended Posts

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>

 

 

Link to comment
https://forums.phpfreaks.com/topic/161423-solved-image-create-problem-please-help/
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.