1

I have a technical question.
I would like to know if is possible to get the url of the website is hosting my iframe. The pages which are hosting my iframe are using following iframe:

<iframe id="vacancy-iframe"
src="http://mypage.come" width="100%"
height="1400"></iframe>

Getting the URL using javaScript I think is not possibile.
Is there a way maybe with PHP or another server programming language?

Daniel
  • 57
  • 2
  • 7

1 Answers1

0

If you want to "collect" all the urls that are calling your page:

You can use the PHP $_SERVER['HTTP_REFERER'].
Then save that information in a database for later consultation.

Notice that this will not check if your page has been called within an iframe.
If the your page is accessed via a link, the url will be the one where the link is.
If it is accessed directly by providing your page url in the adress bar, this value will be empty.

You may also find strange entries in you database over time, like google searches and robots... ;)

Louys Patrice Bessette
  • 33,375
  • 6
  • 36
  • 64