i have my test.php:
<?php
echo "Image:<br/>";
include('draw.php');
?>
and my draw.php:
<?php
$img = imagecreate(250,80);
...
header("Content-type: image/jpeg"); imagejpeg($img); imagedestroy($img);
?>
now, visiting test.php tells me that headers is already sent. How do i show the image in draw.php "realtime" (not by saving to server and loading it using img tag)?
?>
If you want to incorporate this into an html page, change test.php
to this:
<?php
echo "Image:<br/>";
echo '<img src="draw.php" />'
?>
You could just as easily make it a static html page:
<html>
<head>
<title>Test</title>
</head>
<body>
Images: <br />
<img src="draw.php" />
</body>
</html>
Remove echo "Image:<br/>";
from test.php and read carefully about HTTP headers http://php.net/manual/en/function.header.php so that you don't make the same mistake again