I have a script that uses "header('Content-type: image/jpeg');" to show an image. While this is OK for entire web pages that have the content type image/jpeg, it doesn't work when the image is embedded in an html or a php page, such as when in an image link. How can I have the content-type only apply to the embedded image link and not the entire page? Thanks in advance.
you need to create a separate file, such as image1.php and then put the header into that file then src is like this, <img src="image1.php"> and then it should appear properly. Here is the full reference for you: http://us.php.net/gd
and if you have a script that reads userdefined images, you can check the imagetype by using getimagesize (check php.net)