Forum Moderators: open

Message Too Old, No Replies

Detect if site whas loaded by an <img src=""> etc.

         

BlackDex

9:06 am on Nov 6, 2006 (gmt 0)

10+ Year Member



How can i detect if an other website try's to load my site by using an <img> tag?

Like this: <img src="http://www.mysite.com/?blah=foobar">.

Is there some way to detect if this has been requested by an img tag?
Or even an link or script tag?

I Want to prevent this or alteast do something about this.

Thx in advance.

bill

9:32 am on Nov 6, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The term you're looking for is hotlinking [google.com]. There have been several threads here dealing with this issue.

BlackDex

10:22 am on Nov 6, 2006 (gmt 0)

10+ Year Member



Thx for the link.

But i think this is a little bit different.
My problem is, it isn't an image that is being loaded.
It is a URL to a normal site.

There currently is running some contest, and ppl are using the <img> to abuse this to win the contest.

Now i hoped there whas somekind of check to see if the URL requested comes from within a <img> or something.

The site already is protected against hotlinking of images.

Thx.

bill

9:06 am on Nov 7, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I'm not familiar with that technique. Are your log files showing the referrer?

You could always just block the offending IPs.

Trace

1:45 pm on Nov 7, 2006 (gmt 0)

10+ Year Member



It's something quite common for sites that use link exchange scripts.

The scenario is, a certain site allows you to submit your own site for a link trade then adds you to the list. The more hits you send, the higher up the list you go. The idea being the closer you are to the top the more hits you will get back.

The easiest way to cheat that system is to load the targeted site in an iframe or as an image. That way every user that hits your site automatically sends a hit to the tracking list without the user actually having to click a link.

Blocking IPs or even just blocking the domains of offending sites can become a full time job for larger sites. I know a little Javascript can save you from the iframe cheat - but I'm not aware of anything against the image trick.