Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
header.php总是包含在其他 PHP 文件index.php中,例如 ,member.php等。
header.php
index.php
member.php
我怎样才能阻止客户访问我的header.php?
在 顶部index.php,添加:
define('AUTHORISED_TO_INCLUDE', 1);
在 顶部header.php,添加:
if(!defined('AUTHORISED_TO_INCLUDE')) die();