繁体   English   中英

在https页面的iframe中加载http页面

[英]Loading http page in an iframe of https page

我在https网站上有一个页面,说https://www.example.com ,其中包含一个指向同一站点中另一个PHP页面target.php的iframe。

<iframe src="/target.php"></iframe> 

此target.php使用重定向请求到另一个http url

header("Location: http://demosite/page"  ,TRUE, 307) 

不幸的是,从https iframe无法重定向到http站点。 虽然它可以从http页面的iframe使用。

我努力了

file_get_contents("http://demosite/page") 

并卷曲在target.php (而不是标头重定向)。 那些没有以正确的格式返回页面。

请有人告诉我如何在https页面的iframe中显示http页面。

提前致谢 。

在重定向中忽略协议。 然后它将自动使用用于访问target.php的相同协议:

header("Location: //demosite/page", true, 307);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM