I am trying to create a nice modular web application using several files:
./config.inc.php - contains variables for: Title of website, basedir, baseurl, mysqlserver, sqluser, sqlpass, etc
./language/en.php - contains variables to make site multilangual (en=English, se=Swedish)
./functions/ - contains pages with categorized functions
Then there is a page let's say index.php:
...
include (./config.inc.php)
include (./lang/en.php)
include (./functions/session.php)
...
But then when I call CreateSession($var1, $var2), which is a function in session.php, I have to include config.inc.php again within that function to enable it to use the variables stated in config.inc.php.
And for every function in that same session.php document.
I have a feeling this could cause some major issues when using multiple functions from different function-documents.
Is there a way to make these config.inc.php variables globaly known or something so I do not have to 'reload' that page every time?
Thank you!!!😕