Forum Moderators: coopster
Now I want to display the images on my page using:
header ("content-type: image/jpg");
ECHO $imagefile
The result is a print of the code and no image: logo-9ee9e10df14c51c9827fbd5f04c381791239958344.jpg
Im very new to php - any help appreciated.
Thanks in advance
The way I usually do it is that I have the images uploaded to a directory on the server somewhere, for example with a unique name like image247.jpg. Then just put a text(varchar) column in the database, which simply contains 'image247.jpg'. Or you could even use the 'id' column to generate the image name and you wouldn't need an extra field for it.
Then when it comes to build the page I just use the reference to point to wherever it is on the server.
So some user fill in a form and upload an image file - then othe users are able to search in the DB and the results returned are text, dates, images etc.
The output echo is displayed in a table.
All the text, dates etc. will output nicely - but instead of showing an image - the filename is displayed.