HELP - Display images from a database field
Posted: Mon Apr 10, 2006 8:05 pm
I seriously need help with this one or a link to an example (non oop please). I managed to create a basic application to store info and an image in a mysql database. I can display the image all by itself or the data on the form all by itself but I can't find any way to display both 
Displaying the image on the page by itself is pretty straight forward by retrieving the fields and using the header
header("Content-Disposition: attachment; filename=$name");
header("Content-length: $size");
header("Content-type: $type");
echo $content;
Displaying info in text fields by itself is pretty straight forward. Now what I am trying to do is create a basic html page and the image in the database would be in an <img > tag on the html.
I am getting a lot of problems with the headers or img displaying as a bunch of garbled text.
Can anyone help me out or point me in the right direction. I would really appreciate it.
Thanks.
Displaying the image on the page by itself is pretty straight forward by retrieving the fields and using the header
header("Content-Disposition: attachment; filename=$name");
header("Content-length: $size");
header("Content-type: $type");
echo $content;
Displaying info in text fields by itself is pretty straight forward. Now what I am trying to do is create a basic html page and the image in the database would be in an <img > tag on the html.
I am getting a lot of problems with the headers or img displaying as a bunch of garbled text.
Can anyone help me out or point me in the right direction. I would really appreciate it.
Thanks.