【发布时间】:2015-12-03 00:25:18
【问题描述】:
我正在尝试在我的 php 页面中嵌入 YouTube 频道 URL。但它给出了以下错误:
拒绝在 a 中显示“https://www.youtube.com/channel/fakecode” 框架,因为它将“X-Frame-Options”设置为“SAMEORIGIN”。
<div id="bgvideo" >
<div class="container" >
<div class="row" >
<div class="col-sm-8 col-sm-offset-2">
<div class="responsive-video">
<iframe width="420" height="315" src="https://www.youtube.com/channel/fakecode" frameborder="0" allowfullscreen></iframe>
</div>
</div>
</div>
</div>
</div>
【问题讨论】:
-
header('X-Frame-Options: GOFORIT');尝试将此标头设置为您的 php 文件或刀片文件
-
请发布您的代码
-
您为什么要在您的网页中嵌入频道?您是否尝试嵌入视频或播放列表?
-
@MartinBean 是的,我正在尝试嵌入视频或播放列表
标签: php laravel youtube-channels