Is it possible to tell if page is called from <img> tag

Discussion in 'PHP' started by bobby9101, Aug 18, 2007.

  1. #1
    Hi, I am displaying image like:
    http://site.com/photo.php?picture=photo1.jpg
    And on that page it displays the photo, but you can also see the photo on another URL using:
    <img src="http://site.com/photo.php?picture=photo1.jpg"/>
    Is it possible via PHP on photo.php to tell if the user is viewing the page via the <img> tag or if they are on the page.
     
    bobby9101, Aug 18, 2007 IP
  2. LiteSeek.com

    LiteSeek.com Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I suppose that if the user would type in directly the URL there would be no http_referrer, and in the second case the http_referrer would be the one of your page.

    So yep it can be done.
     
    LiteSeek.com, Aug 18, 2007 IP