I don't want the php file to be browsed separately. php splits the file into several files and uses include () reference during runtime. how to do this ------ solution ------------------ in index. define a constant in php, and then judge whether the constant has been defined in a separate small file. if not, exit the program. Define a constant: PHPcodedifineACCESStru does not want the php file to be browsed separately
For ease of processing, I split index. php into several files and reference it with include () during runtime. how can I do this?
------ Solution --------------------
Define a constant in index. php, and then judge whether the constant has been defined in a separate small file. if not, exit the program.
Define constants:
PHP code
Difine ACCESS = true;
------ Solution --------------------
You can also remove the execution permission of small files.
------ Solution --------------------
First floor
------ Solution --------------------
Cannot be accessed by direct URLs
If (basename ($ _ SERVER ['php _ SELF ']) = basename (_ FILE _) return;
// The content of the program file is as follows:
------ Solution --------------------
Place the include files outside the root directory of the document.