need help with GD
Posted: Fri Jul 11, 2008 7:16 am
So ... I have this on a page :
$width=$coef*130;
echo "<p align=\"left\"><img src=\"image.php\"> ".$choice."<small> (".$mycount.")</small></p>";
and image.php contains the following :
<?php
header("Content-type: image/gif");
$im = imagecreate(130, 3);
$black = imagecolorallocate($im, 0, 0, 0);
$red = imagecolorallocate($im, 255, 0, 0);
imagefilledrectangle($im,0, 0, $width, 3, $red);
imagegif($im);
?>
But the red part doesn't appear , and I think it has something to do with $width , the imagefilledrectangle() doesn't get the $width ...
Can you please help me ?
$width=$coef*130;
echo "<p align=\"left\"><img src=\"image.php\"> ".$choice."<small> (".$mycount.")</small></p>";
and image.php contains the following :
<?php
header("Content-type: image/gif");
$im = imagecreate(130, 3);
$black = imagecolorallocate($im, 0, 0, 0);
$red = imagecolorallocate($im, 255, 0, 0);
imagefilledrectangle($im,0, 0, $width, 3, $red);
imagegif($im);
?>
But the red part doesn't appear , and I think it has something to do with $width , the imagefilledrectangle() doesn't get the $width ...
Can you please help me ?