joecooper Posted August 7, 2007 Share Posted August 7, 2007 im not sure on where to start with this. i need the code to return as an image. as in, not like using html to add a link to the image like <img scr="image.jpg"> litually if on a html page i can add this html: <img scr="image.php"> and it would return an image Link to comment https://forums.phpfreaks.com/topic/63798-returning-an-image/ Share on other sites More sharing options...
teng84 Posted August 7, 2007 Share Posted August 7, 2007 what do you mean ???? returning an image with php is same as html look php generates data to be output by an html so whats your question ??? Link to comment https://forums.phpfreaks.com/topic/63798-returning-an-image/#findComment-317937 Share on other sites More sharing options...
joecooper Posted August 7, 2007 Author Share Posted August 7, 2007 i have images in a folder called images i want to have a script in image.php that will take an image from that folder, (i can do that), and then output it. so more or less, the image link would be image.php rather than the image inside the folder. kinda like a verification image. basicaly i dont want the user to be able to find the image link, i want the script to get the image for them Link to comment https://forums.phpfreaks.com/topic/63798-returning-an-image/#findComment-317940 Share on other sites More sharing options...
teng84 Posted August 7, 2007 Share Posted August 7, 2007 $image = $_GET['image']; echo "<img src=\"images/$image\" />"; is that what you mean??? Link to comment https://forums.phpfreaks.com/topic/63798-returning-an-image/#findComment-317945 Share on other sites More sharing options...
joecooper Posted August 7, 2007 Author Share Posted August 7, 2007 no, i dont want the html code to return it. you know how you get image verification scripts, they make an image, and then posts it with code like: echo "<img src=\"image.php?image=1\">"; i need it to instead of make an image, it grabs it from the images folder. and then the script is the actual image Link to comment https://forums.phpfreaks.com/topic/63798-returning-an-image/#findComment-317949 Share on other sites More sharing options...
joecooper Posted August 7, 2007 Author Share Posted August 7, 2007 there is something about adding this line at the top: Header("Content-Type: image/png"); which will tell the browser it is an image? Link to comment https://forums.phpfreaks.com/topic/63798-returning-an-image/#findComment-317958 Share on other sites More sharing options...
Recommended Posts