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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.