ATTN: Leon Atkinson (aka: generating a graph in the middle of a page?)
| From: | Daevid Vincent | Date: | Wed, 16 Aug 2000 23:55:49 +0000 |
| Subject: | ATTN: Leon Atkinson (aka: generating a graph in the middle of a page?) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-12126@lists.php.net to get a copy of this message | ||
Hi, I have your "Core PHP Programming book" and wanted to start using images
for my graphs rather than the HTML tables as I've been doing.
Nice example 17-3.php3, however, how can I "embed" the graph into an
existing PHP page... that is, how can I do this:
The problem is that your example uses header("Content-type: image/gif"); to
display the image?
which in turn generates the error...
Warning: Cannot add more header information - the header was already sent
(header information may be added only before any output is generated from
the script - check for text or whitespace outside PHP tags, or calls to
functions that output text)
----- snip -----
<html>
<head>
<title>graph image</title>
</head>
<body>
Here is a graph of your data
<?php
your code to generate a graph.
(ie. example 17-3)
?>
<P>
press <A HREF="more.phtml">here</A> for more options.
</body>
</html>