I have looked at several other similar questions, but unfortunately none of them have helped with the problem I am having.
This is the script.
<?php
// returns a PNG graph from the $_GET['per'] variable
$per = imagecreate(302,7);
$background = imagecolorallocate($per, 0xFF, 0xFF, 0xFF);
$foreground = imagecolorallocate($per, 0x00, 0x8A, 0x01);
$border = imagecolorallocate($per, 0x99, 0x99, 0x99);
if ($_GET['per'] > 0)
{
$grad = imagecreatefrompng("images/grad.png");
$per2 = imagecopy($per, $grad, 1, 1, 0, 0, ($_GET['per'] * 3), 5);
imagerectangle($per, 0, 0, 301, 6, $border);
}
header("Content-type: image/png");
imagepng($per,NULL,5);
?>
I have checked GD support is on so I am not sure what the problem is. If I build just a simple bar without use of an image it will work fine, but when I try to build with an image it just shows a picture of a broken image.