On Tue, 3 Sep 2002 kapil_karekar@vsnl.net wrote:
Please fix your line length.
When I include the PHP file(ex. graph.php), which generates the PNG image, in my current html file, it gives an error saying "Headers already sent". It then displays the image as ASCII text. This happens only when the include statement is preceeded by any html tags.
Umm, you can't send your html and image as part of the same data stream. They have to be two separate data streams, in response to two separate HTTP requests.
ie, user requests page, you send:
Content-type: text/html
<html>....
<img src="script.php?send-image">
user requests script.php?send-image, you send:
Content-type: image/png
image data here
You're trying to send both in a single HTTP response.