I'd like to be able to have a function like display_graph() which then sends a graph to the broswer!
That will work if the display graph is in its own file and one does say
Code: Select all
<img src="display_graph.php"/>eg
Code: Select all
function display_graph()
{
echo '<img src="'.graph();.'"/>';
}
function graph()
{
// simple working image for now... to demonstarte principle I would like to achieve.
header ("Content-type: image/png");
$newImg = ImageCreate(250,250);
$skyblue = ImageColorAllocate($newImg,136,193,255);
ImageFill($newImg,0,0,$skyblue);
ImagePNG($newImg);
ImageDestroy($newImg);
}