Displaying generated images

Is it possible to change content-type within a page?  I want to put out some HTML and then change the content-type to image/gif and then throw in my generated gif output and then switch back to HTML.  The problem is that my directive to change the content-type to image/gif is just appearing as text on the page.  Can this be done or do I need to put the gif in a file and display it within HTML? Or this there a better way to deal with dynamically generated images within the page?  Thanks.
Who is Participating?
sybeConnect With a Mentor Commented:
You can't switch from MIME-type within one document. If you want to display a generated image, do it in a way like this:

<img src="/cgi-bin/generated_image.pl?this=querystring">

in which generated_image.pl is a cgi which generates the image.
cmulzerAuthor Commented:
Thanks!  That was just what I needed.
All Courses

From novice to tech pro — start learning today.