繁体   English   中英

允许页面仅加载到iframe中并阻止直接访问

[英]Allow a page to only load in an iframe and prevent direct access

如何允许我的PHP文件仅在iframe中加载?

例如:

防止直接访问:

example.com/Loader.php

允许iframe访问:

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

您可以为此使用JavaScript

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

暂无
暂无

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

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