Sk MiRaj
Sk MiRaj

Reputation: 59

Alternative to include file or require_once() in php

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.

Upvotes: 0

Views: 4032

Answers (1)

cweiske
cweiske

Reputation: 31088

You may use the php.ini setting auto_prepend_file to automatically include files when the php process is started.

Upvotes: 3

Related Questions