disable access to included files

前端 未结 3 449
臣服心动
臣服心动 2021-01-22 18:59

i have a litte question..

i want to disable the direct access to my included files. (example header.tpl.php, footer.tpl.php, confic.inc.php, db-connect.inc.php ect.)

3条回答
  •  孤街浪徒
    2021-01-22 19:34

    if (basename($_SERVER['SCRIPT_FILENAME']) == basename(__FILE__))
    {
        //header("Location: index.php");
        exit("NOT ALLOWED");
    }
    

提交回复
热议问题