in the html page have:
<html>
...
<img src="myimage.php?params=here">
...
</html>

in myimage.php have:
<?
// get image data from database here
header("content-type: image/jpg");  // or whatever type it is
echo base64_decode($image_data);
?>

-----Original Message-----
From: Christofe DuBois [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 07, 2001 10:35 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Help displaying an image stored in a database...


I would like to store an image in a database and then allow users to select
the image for display...

I can upload the file, and write it to the database.  I base64_encode ' d it
and dropped it in a longblob field.

I then query the database, pull the encoded image out...  now what...

I have tried simply saying <img src=$encoded_var> and that doesn't work
worth squat...

So basically, I have:

HTML

HTML

HTML
HTML
HTML

Image to display here

HTML
HTML

HTML


How do I get the iamge to pull from teh database and display there in the
middle of all the HTML?

-Chris




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to