What's the best way to only allow a PHP file to be included?

后端 未结 8 2157
梦毁少年i
梦毁少年i 2021-01-04 10:07

I want to make sure people can\'t type the name of a PHP script in the URL and run it. What\'s the best way of doing this?

I could set a variable in the file that wi

8条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-04 10:24

    The Zend Framework recommends you keep the files outside the web root, as Unkwntech has suggested. I'd say this is the safest and most fool proof solution.

提交回复
热议问题