|
Posted by Rik on 03/08/07 12:30
bill <nobody@spamcop.net> wrote:
> I am in the preliminary design stage.
> client wants to serve one of several small gifs from a database
> depending on user selection. I can do all of that easily except serve
> the images.
>
> I imagine that I will have an img tag that will invoke a php script, but
> how do I serve the img so that the browser displays it as an image
> rather than (garbage) text ?
Default mime type for php is usually text/html. For images, you'd have to
send the correct header.
header('Content-Type: image/gif');
If the mime-types differs, optionally use getimagesize to get the correct
mimetype of the image.
--
Rik Wasmus
Posted on Usenet, not any forum you might see this in.
Ask Smart Questions: http://tinyurl.com/anel
Navigation:
[Reply to this message]
|