[prog] On the fly graphs with php
Clifford Crawford
cjc26 at cornell.edu
Fri Jul 15 05:03:43 EST 2005
On 2005/07/14, at 13:59, Conor Daly wrote:
> However, if I
>
> include("chart.php");
>
> I get a "cannot send header" error since other stuff has already
> happened.
My guess is this is what needs to be fixed; you need to be able to
set the header to "image/png" so that the browser can correctly
interpret the data. What exactly do you mean by "other stuff has
already happened"? Is it outputting something before showImage() is
called? If it does, then PHP might be setting the header to "text/
html" behind your back. Also, check for any stray spaces or anything
outside of <? ?> tags, that could cause the header to be set wrong too.
> showImage() looks like:
>
> function showImage() {
>
> header(image/png);
> imagepng($image);
> imagedestroy($image);
> }
>
> where $image has been generated as a result of the call to makeImage()
> earlier.
--
Cliff Crawford *** cjc26 at cornell.edu
"The perfection of art is to conceal art." -- Quintilian
More information about the Programming
mailing list