Reply to Re: serving an image

Your name:

Reply:


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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация