I am trying to import some variables from a PHP script. It seems simple, but I can't get it to work.
The script contains some global variables:
$server_hostname = "localhost";
$server_database = "kimai";
$server_username = "root";
$server_password = "";
$server_conn = "mysql";
$server_type = "";
$server_prefix = "kimai_";
$language = "en";
$password_salt = "7c0wFhYHHnK5hJsNI9Coo";
Then in my script, I would like to access these variables, so I did:
require_once 'includes/autoconf.php';
var_dump($server_hostname);
But it just outputs NULL. I also tried:
require_once 'includes/autoconf.php';
global $server_hostname;
var_dump($server_hostname);
but still not working.
I have added several statements echoto the "autoconf.php" file, so I know that it is loading.
How can I access these variables?
source
share