okay I have a URL query that contain's an img source - display.php?f=/Upload/art/&p=Bkground.jpg
What would the code be inside display.php to embedd the image in? also I'm not sure that the query is correct, if so then please correct me. Thanks!![]()
okay I have a URL query that contain's an img source - display.php?f=/Upload/art/&p=Bkground.jpg
What would the code be inside display.php to embedd the image in? also I'm not sure that the query is correct, if so then please correct me. Thanks!![]()
Do you want to output HTML that links to the image, or the image itself? If the former, simply generate an <img> tag with the appropriate value for the src attribute. If the latter, generate relevant HTTP headers (such as Content-type; use http://php.net/Fileinfo to get the MIME type for a file), then something like readfile() to output the file.
Make sure your script can't be exploited to display arbitrary files.
Last edited by misson; 05-28-2010 at 05:33 PM.
Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.Misson, not Mission.