0

sorry for the bad title, I don't know what the technology is called so basically I want to know if I put an iframe on a website and know if the website still put my iframe on his/her website without checking into the website where I put my iframe at

all help appreciated

Thanks in advance :)

  • 1
    if you're looking to prevent it, you can just set the header => http://stackoverflow.com/questions/5881139/how-to-block-iframe-call – PlantTheIdea Mar 27 '13 at 15:26
  • You want to know if an iFrame exists on a site? Then there is no way around checking into the site (either yourself or via script) – kero Mar 27 '13 at 15:28
  • So you want to make sure the page is still on his site. Than you need to alter the page you show in the iFrame and report back to you. You could use a simple ajax method to echo the window.top.location to your server and store it. But then you still dont know if the iframe is visible on the site or moved of screen with `left:-10000px;`. There are a ton of ways to bypass any check so the only way to be sure is to check it. – Hugo Delsing Mar 27 '13 at 15:30
  • you have to do a script who check this periodically, can't be instant alert – khaled_webdev Mar 27 '13 at 15:35

2 Answers2

0

you could log $_SERVER["HTTP_REFERER"]

0

Adding to @Thomas Kjær Pedersen answer:

you can run an automated wget (in commandline) or a file_get_contents (with furl_open) or a curl request (http://www.php.net/manual/en/book.curl.php) of the url where you expect the iframe to be. Then at the same time you would need to log the $_SERVER["HTTP_REFERER"] on the page that acts as iframe. You can then verify $_SERVER["REMOTE_ADDR"] with your server IP - the one that runs the automatic script - to verify the origin and see whether a referer hit was given..

Sounds logically?

Luceos
  • 6,629
  • 1
  • 35
  • 65
  • if you find any problems, just comment here or open a new question and refer to it here; post your code so we'll know what you've tried so far. – Luceos Mar 29 '13 at 08:42