Jump to content

I Need A Script On How To Display Picture


Panta

Recommended Posts

Please friends please help me on how to display a picture that is in the data base on a browser, so that the user can see his uploded picture, and if possible print. thanks

Link to comment
Share on other sites

Which fields do you have in the database? Do you have the binary data and the original filename or extension?
yes i have both in my data base, so i need help on how to display the image so that thet user will see it on the browser
Link to comment
Share on other sites

Basically, all you need to do is output the correct content-type header based on what the original extension was, and then output the binary data. e.g., if the image is a PNG:header('Content-Type: image/png');header('Content-Length: . ' strlen($image_data));echo $image_data;You can use a script that outputs that as the src for an image tag, e.g.:<img src="get_image.php">

Link to comment
Share on other sites

header('Content-Length: '. strlen($image_data));
Quote and concatenator were back-to-front...
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...