Include file in all PHP files recursively

I have this file that I want to run first before each PHP file. How can i achieve this? Now I use only the classic php method.

run_me_first.php

and I want to include it in my entire PHP file. Besides having to manually do it manually, is there a way not to do it manually?

+4
source share
3 answers

Try using the .htaccess file:

php_value auto_prepend_file "/path/to/file/run_me_first.php"

If this is free FTP, they may have some restrictions on the settings that you can change.

+1
source

require include php . , , , .

+1

, . , header.php. (. Php,.js), php . header.php php .

header.php . , . , .

+1

Source: https://habr.com/ru/post/1527061/


All Articles