0

I have a php-page, that should be loaded through iframe on my site.

<iframe src="http://domain.com/page.php"></iframe>

How can I determine, what site is trying to load this page through iframe and deny page loading if it's loaded not from my domain.com? I need it done as PHP method.

PSS
  • 5,561
  • 5
  • 28
  • 30
Vasily
  • 27
  • 2

1 Answers1

3

Use the X-Frame-Options HTTP response header.

X-Frame-Options: SAMEORIGIN
Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335