I would like to make a config.php file with certain variables that are site global.
Such as
$database_host
$database_username
$database_password
$business_name
This way, the user can modify these settings to allow site wide changes in a single file. Much like CSS.
Now, the questions.
Is this a wise and secure way of doing this?
Does anyone have any better ideas?
How do I assign them as global?
I have tried and it works for files accessed using an include but not files outside the include range.
ie
<?php
include ('variables.php')
echo('Host - '.$database_host);
include ('control/cp.php');
?>
Works fine at displaying $database_host.
But if I put the following code in cp.php
<?php
echo('Host - '.$database_host);
?>
it display
Host =
Is there a way to define site global variables that can be accessed from any file within the site.
Thanks in advance
Quentin