【问题标题】:Allow a page to only load in an iframe and prevent direct access允许页面仅在 iframe 中加载并防止直接访问
【发布时间】:2016-10-15 01:01:10
【问题描述】:

如何让我的 PHP 文件只加载到 iframe 中?

例如:

阻止直接访问:

example.com/Loader.php

允许 iframe 访问:

<iframe name="TEST" src="Example.com/Loader.php"></iframe>

【问题讨论】:

标签: php .htaccess iframe


【解决方案1】:

您可以为此使用 JavaScript

if(window==window.top) {
    // not in an iframe
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-05-23
    • 2013-03-20
    • 1970-01-01
    • 2010-11-05
    • 2010-09-16
    • 2011-02-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多