Get the URL of a HotLinked image

Hi All,

Thanks to the great community here I have managed to solve one issue, now I have other one:
How I can know the url that is hotlinking a image I'm serving inside CI.

So the image I'm serving like this

Now I want to know what pages are displaying the image.

Thanks in advanced

You want to know the referring url is for the image? You can use $_SERVER['HTTP_REFERER'] Have I understood?

$_SERVER[’HTTP_REFERER’] will only work if the page was visited via a click but not if it is a direct visit.

so if it is set you record the referrer and if it isn't you know there is no referrer so there is nothing to record. I guess I'm not really sure what the issue is.

The images will be hotlinked from my site, that's why I have to keep track of where they are been displayed.

Referer will only be set if the page was visited via other page, when you jup to a link from the address bar directly no referer will be set as far as I know.

You have a controller which is responsible for file-reading the images and then serves the image data via the header correct? and presumably you have links on other pages which point to that page. If I understand you correctly you're interested in knowing which links are being clicked to access you image serving script. So in the image serving controller you check HTTP_REFERER and if it's set you have the referring page to do what you want with. If it isn't you know that an attempt was made to access the page directly.

Perhaps a better description of your requirements would help.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.