PHP how to autoinclude? -
i have following project structure:
\ |- foldera | |- folderb | | |- index.php | |- index.php |- index.php |- config.php
i want config.php loaded automatically (without 'include' directive inside index.php) whenever access:
http:://mysitename/index.php http:://mysitename/foldera/index.php http:://mysitename/foldera/folderb/index.php
or other php file in project.
how can achieve that?
the way make works use auto_prepend_file php.ini directive:
auto_prepend_file = /path/to/config.php
or in .htaccess:
php_value auto_prepend_file config.php
Comments
Post a Comment