+ Reply to Thread
Results 1 to 2 of 2

Thread: Image source from URL query

  1. #1
    begamer26 is offline x10Hosting Member begamer26 is an unknown quantity at this point
    Join Date
    Nov 2009
    Posts
    24

    Image source from URL query

    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!

  2. #2
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Image source from URL query

    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.

+ Reply to Thread

Similar Threads

  1. hello and a query
    By cjfgarcia in forum Introductions
    Replies: 1
    Last Post: 06-26-2009, 10:15 AM
  2. Hello - and a query
    By paulman in forum Introductions
    Replies: 4
    Last Post: 06-19-2009, 12:03 PM
  3. Big Image Small Image.
    By Parsa44 in forum Graphics & Webdesign
    Replies: 4
    Last Post: 03-09-2009, 02:40 AM
  4. Replies: 13
    Last Post: 12-03-2008, 10:31 AM
  5. My Open Source Image Hosting script :)
    By vaska94 in forum Scripts & 3rd Party Apps
    Replies: 2
    Last Post: 09-01-2008, 06:56 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers