[英]'X-Frame-Options' to 'SAMEORIGIN
Im trying to embeded some site like this 我试图嵌入这样的网站
<iframe src="http://somesite.com"></iframe>
But im getting this error. 但即时通讯收到此错误。
Refused to display in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'
Is there a way how to fix this error? 有没有办法解决此错误?
Site that I need to embeded isnt mine 我需要嵌入的网站不是我的
您可以要求网站所有者更改对您域的访问权限,也可以尝试使用curl或file_get_contents从php端进行访问。
This will do the trick, it gets the contents of remote site and pastes it. 这将解决问题,它将获取远程站点的内容并将其粘贴。
<?php
$url = "https://google.com";
echo '<base href="'.$url.'" />' . file_get_contents($url);
?>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.