I am new to PHP so don’t know if there is any alternative to require_once(). My issue is: currently I am including database configuration file on almost each and every file which needs to connect with database using require_once(). I don’t want to include my configuration file on each and every file because it may cause some security risk. Any kind of help would be apriciated. Thanks in advance.
I am new to PHP so don’t know if there is any alternative to
Share
You may use the php.ini setting auto_prepend_file to automatically include files when the php process is started.