Re: how to show an image from database

This is a discussion on Re: how to show an image from database within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Carina wrote: > I'm trying to show an image that I'm getting from the database. I'm able ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-21-2003
Thomas Baker
 
Posts: n/a
Default Re: how to show an image from database

Carina wrote:
> I'm trying to show an image that I'm getting from the database. I'm able to
> get the instructions for the pictures. But I need to get it into an image
> and show it in HTML.
>
> Carina


I don't know if you can do it in PHP but what you want to do is write a
separate page where you set the MIME type of the page to image/gif (or
whatever)* and then write out the bytes of the image (assuming it is the
image you have stored in the db and not just its name/location) then you
can reference this from other pages like:

<img src="/image.php?db_id=324" />


And that gets image 324 from the db. And of course the db_id can be
dynamically generated in the non-image PHP page or even in the image one
if you pass in criteria.

Does that make sense?

T

* = I'm being a bit vague here because I'm not sure exactly what you do
in PHP. There's probably some kind of ResponseType method on the
Response object (if there is such a thing in PHP!)

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:31 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0