久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

為什么 iframe 對 yahoo.com 不起作用

Why Iframe dosen#39;t work for yahoo.com(為什么 iframe 對 yahoo.com 不起作用)
本文介紹了為什么 iframe 對 yahoo.com 不起作用的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我發現這不起作用:

<iframe src="http://www.yahoo.com"> </iframe>

我已閱讀此問題,但我沒有了解添加的含義:

I have read this question, but I don't understand what they mean by add:

<?php
header('X-Frame-Options: GOFORIT'); 
?>

我嘗試將其添加到我的 html 文件的頂部(當然是將其更改為 php 文件),我的 php 文件變成了:

I tried to add this to the top of my html file(change it to php file, of course), and my php file became:

<?php
header('X-Frame-Options: GOFORIT'); 
?>
<iframe src="http://www.yahoo.com"> </iframe>

我在我的 appserv(使用 php 5.2.6)中運行它,但它不起作用.有人能解釋一下我應該怎么做才能克服這個問題嗎?

I run it in my appserv(with php 5.2.6), and it doesn't work. Could anybody explain what should I do exactly to overcome this?

推薦答案

你運氣不好:yahoo.com 不允許你在 iframe 中嵌入他們的網站.facebook 或其他熱門網站也沒有.

You're out of luck: yahoo.com doesn't allow you to embed their site in an iframe. Nor does facebook or other popular sites.

此限制的原因是點擊劫持.

您可以通過檢查其站點的響應標頭來驗證這一點;他們指定 X-Frame-Options:SAMEORIGIN 這意味著只有 yahoo.com 可以嵌入 yahoo.com 頁面.

You can verify this by checking the response headers from their site; they specify X-Frame-Options:SAMEORIGIN which means only yahoo.com can embed yahoo.com pages.

一些較舊的瀏覽器不會強制執行標頭,但所有新瀏覽器都會.Afaik,沒有簡單的方法可以解決.

Some older browsers won't enforce the header but all new ones will. Afaik, there's no simple way around it.

我能想到的唯一解決方案是實現代理腳本,即您嵌入一個腳本,該腳本位于您的服務器上,為您獲取遠程內容.

The only solution I can think of is implementing a proxy script, i.e. you embed a script that lives on your server that fetches the remote content for you.

例如.您的 iframe 調用/my-proxy.php?url=http://www.yahoo.com/",該腳本看起來喜歡:

Eg. your iframe calls "/my-proxy.php?url=http://www.yahoo.com/" and that script would look like:

<?php

header('X-Frame-Options: SAMEORIGIN'); // don't allow other sites to use my proxy
echo file_get_contents($_GET['url']);

您的里程可能會有所不同...

Your mileage may vary...

這篇關于為什么 iframe 對 yahoo.com 不起作用的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Cannot use #39;Object as class name as it is reserved Cake 2.2.x(不能使用 Object 作為類名,因為它是保留的 Cake 2.2.x)
Session is lost after an OAuth redirect(OAuth 重定向后會話丟失)
Pagination Sort in Cakephp 3.x(Cakephp 3.x 中的分頁排序)
CakePHP Shared core for multiple apps(CakePHP 多個應用程序的共享核心)
Login [ Auth-gt;identify() ] always false on CakePHP 3(在 CakePHP 3 上登錄 [ Auth-identify() ] 始終為 false)
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 87 bytes)(致命錯誤:允許的內存大小為 134217728 字節已用盡(嘗試分配 87 字節))
主站蜘蛛池模板: 国产免费又色又爽又黄在线观看 | 日韩一区二区三区在线播放 | 成人免费精品视频 | 成av在线 | 91免费视频 | 亚洲精品自拍 | 免费一区二区三区 | www.亚洲精品| 99re视频这里只有精品 | 免费一区在线 | 亚洲 欧美 精品 | 久久亚洲一区二区 | 欧美另类视频 | 久久久久久久久久久久91 | 欧美综合一区二区三区 | 2018天天干天天操 | 日韩高清www | av中文字幕在线观看 | 久草免费视| 97精品国产97久久久久久免费 | 中文字幕在线播放第一页 | 日韩午夜在线播放 | 天天操欧美 | 久久久精品影院 | 欧美视频免费在线 | 久久国产日韩欧美 | 国产黄色免费网站 | 午夜影院在线观看免费 | 日本免费网 | 亚洲精品一区二区三区四区高清 | 农村真人裸体丰满少妇毛片 | 欧美一区二区三区久久精品 | 久产久精国产品 | 国产中文字幕在线观看 | 伊人电影院av | 国产精品久久久久久久午夜 | 国产精品爱久久久久久久 | 91久久久久久| a级在线 | 乱码av午夜噜噜噜噜动漫 | 中国美女撒尿txxxxx视频 |