0

Hi I asked a similar question earlier about retrieving an image from a MySQL database Blob.

I am using code as:

header("Content-type: image/jpeg"); // change it to the right extension 
print $image;   //where image is the blob file

This code is nested inside of a webpage, so should I still modify the header? When I include the header() it removes all of the webpage code which I assume is because I am changing the file type the browser is rendering to image/jpeg? How can i show the image inside of a webpage? Thanks!

1
  • please properly format your code by highlighting it after you paste/type it in and press the code button in the toolbar. Commented Nov 20, 2009 at 2:51

1 Answer 1

1

You can't show an image inside a webpage (well you can, but that's a different story and probably not what you want). You need to put the code that retrieves the image from a database into a separate file, and include this file in your web page using

<img src="filename.php">
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.