Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Header

Status
Not open for further replies.

ilmaggy

Programmer
Jan 4, 2005
11
NL
Hi,

I want the script to output a jpeg image. But after that I want a html form as output. First I use header('Content type: image/jpeg');
If I use header('content type: text/html'); in the same script it says:
Warning: Cannot add header information - headers already sent by ....
could anyone help me?
Thanking you in advance,
ruben.
 
Is the image coming from a db? If so, you can write the image content stuff all in another page and do this:

Code:
<img src='/path/to/page.php?img_id=$something'>

Then the page that gets and displays the image nicely

Bastien

Cat, the other other white meat
 
The image is not coming from a db. The script makes the image itself:
Code:
<?php
header('Content type: image/jpeg');
$background = imagecreatefromjpeg("background.jpg");
imagettftext($background,19,0,83,160,$color,$font,$text);
imagejpeg($background);
imagedestroy($background);
?>
Now I want to have something like this:
- Some html;
- The image;
- again some html.

I have to use header('Content type: image/jpeg'); but if I do that, I can't show any html.
What to do?
thnnking you in advance,
ruben.
 
same deal then...you write your normal html page and for the image use the tag to call the image drawing page as I showed above

Bastien

Cat, the other other white meat
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top