in reply to Sending multiple http headers

You can't set multiple HTTP headers in one call. Once a certain content-type is set in the HTTP header, you're stuck with it. You can however generate different data & content-types depending on certain parameters... check Re: Displaying randomly created png's in HTML for more specifics and a link to the correct RFC.

Greetz
Beatnik
... Quidquid perl dictum sit, altum viditur.

Replies are listed 'Best First'.
Re: Re: Sending multiple http headers
by Anonymous Monk on Aug 22, 2001 at 20:39 UTC
    These are two separate web server requests. The first one fetches the html document with the IMG SRC=/cgi-bin/images/whatever.png. This content type should be set to text/html. The web browser will make a separate request for whatever.png. This will be a separate cgi script that just sets the content type to image/png (i think) and basically prints the binary image file.
      "I have a script which needs to output both html and graphics on the same page. "
      and
      "..., it appears I will need to send two content-type headers ( text/html and image/png )."

      The question was kinda tricky. My response did include the two request solution.

      I doubt Cines answer below actually works on web browsers. MIME types and HTTP content-types are similar but not exactly the same.

      Greetz
      Beatnik
      ... Quidquid perl dictum sit, altum viditur.