Image source from URL query

begamer26

New Member
Messages
24
Reaction score
0
Points
0
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! :redface:
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
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:
Top