簡體   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