can't load images
Moderator: General Moderators
can't load images
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.....
- greyhoundcode
- Forum Regular
- Posts: 613
- Joined: Mon Feb 11, 2008 4:22 am
Re: can't load images
Let's see some code 
Re: can't load images
<?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.
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.