0

Today i worked on small home project, and wanted to show some URLs into iframe. But when load my aplication, i got this error into console:

Refused to display 'https://www.google.com/' in a frame because it set 'X-Frame-Options' to 'sameorigin'.

and site is not showing into iframe at all. Searched around (including Stackoverflow allready placed questions, and found some answers like this into adding code into iframe, but dont seems to make changes. The iframe configuration i have is this:

<iframe src="{$ad_info.url}" id="pgl" class="surfer_frame" frameborder = "0" ></iframe>

Some help how to avoid this warning, and show all pages into iframe?

Doroti Henridgz
  • 105
  • 3
  • 13
  • 3
    Google does not want you to, and might also be running JavaScript checks in addition to the header. If you do want to go against their wishes you might be able to fetch using AJAX (client) or cURL (server) and then modify the HTML that is fetched. – Dave S Aug 18 '18 at 18:29
  • I must use iframe. That is from php script. – Doroti Henridgz Aug 18 '18 at 20:25
  • Why do you need to embed google on your site? – zenzelezz Aug 18 '18 at 22:16
  • Site is just example. I need for other site. – Doroti Henridgz Aug 19 '18 at 13:34
  • 1
    Don't use Google as an example for iframes. Most sites will not throw that error in the console. Also, iframes are deprecated in XHTML Strict. You should use `object` or `embed` instead. – altrisi Aug 20 '18 at 10:47

0 Answers0