can't load images

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
turab
Forum Newbie
Posts: 2
Joined: Mon Feb 15, 2010 3:34 pm

can't load images

Post by turab »

I've been using the GD class for loading images and working with graphics, and it worked fine in the beginning, but now whenever I try code that loads images, the webpage does not show any image, instead its just a box with a red cross (the one you get when image isn't loaded). What did I do wrong??? need immediate help.....
User avatar
greyhoundcode
Forum Regular
Posts: 613
Joined: Mon Feb 11, 2008 4:22 am

Re: can't load images

Post by greyhoundcode »

Let's see some code 8O
turab
Forum Newbie
Posts: 2
Joined: Mon Feb 15, 2010 3:34 pm

Re: can't load images

Post by turab »

<?php
header("Content-type: image/png");
$image = imagecreate( 200, 200 );
$red = imagecolorallocate($image, 255,0,0);
$blue = imagecolorallocate($image, 0,0,255 );
$points = array ( 10, 10,
190, 190,
190, 10,
10, 190
);
imagefilledpolygon( $image, $points, count( $points )/2 , $blue );
imagepng($image);
?>

this is the code, and while there seems nothing wrong with the code, something must be wrong with my installation or God knows what, coz there are no images loading.
Post Reply