|
Posted by bill on 03/09/07 12:05
Rik wrote:
> 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
thanks for the suggestions.
If I send the correct header, will that override the text/html
header or will both be sent ?
bill
Navigation:
[Reply to this message]
|