Well, it looks like you're outputting HTML before another script tries to modify the header information. JPGraph sends headers to the client to let it know that it's outputting an image, not just text/html.
If you want an HTML form to appear, then you'll have to write it as a separate script than your graph generating script.
<?php // my_graph.php
// this is your PHP script that generates graphs
...
?>
<?php // my_form.php
// This is your php script that generates a form
echo "<form>...</form>\n";
// This is how you'd show a graph image on that page:
echo "<img src=\"my_graph.php\">\n";
?>
See, you submit the form variables to the HTML page, and it generates the IMG tags appropriate to create your graph.
The easiest way to forward the user selections is to append their choices to the URL of the image:
<img src="my_graph.php?user_input=some_value">
I hope this makes sense and that you can apply this to your application. The bottom line is that you **CAN NOT** output text from a script that generates binary output (for example, an image from jpGraph).
Take care,
Nik
http://www.bigaction.org/