How to know if php script is called via require_once()?

后端 未结 11 953
旧巷少年郎
旧巷少年郎 2021-01-07 02:24

My webapp has a buch of modules. Each module has a \'main\' php script which loads submodules based on a query sent to the main module:

//file: clientes.php
         


        
11条回答
  •  情歌与酒
    2021-01-07 02:42

    For the sake of completeness, the other possibility is to move such files to a directory that's not publicly available. However, some control panels used by hosting providers make this impossible. In such case, if you are using Apache you can place an .htaccess file inside the directory:

    #
    # Private directory
    #
    Order allow,deny
    Deny from all
    

提交回复
热议问题