Hi,
here's the deal:
I have a config.php file in which I have set a few var's, to use in the
whole site. E.g.:
$db_host = "localhost" ;
Then I also have a class, which is supposed to handle all database
functions. In this class I try to recover the var's from my config file,
but this just doesn't seem to work. I tried to put the following
statements in the constructor as well as in a plain function, but the
output of the var is always empty.
include("config .php");
global $db_host;
echo "value of db_host: ".$db_host;
Now, I have a slight suspicion that it might have to do with the fact
that I'm using classes, but I don't know what's wrong. Normally I should
be able to use the values from the config.php file, right?
greetz
<T!M> aka wEEdpEckEr
here's the deal:
I have a config.php file in which I have set a few var's, to use in the
whole site. E.g.:
$db_host = "localhost" ;
Then I also have a class, which is supposed to handle all database
functions. In this class I try to recover the var's from my config file,
but this just doesn't seem to work. I tried to put the following
statements in the constructor as well as in a plain function, but the
output of the var is always empty.
include("config .php");
global $db_host;
echo "value of db_host: ".$db_host;
Now, I have a slight suspicion that it might have to do with the fact
that I'm using classes, but I don't know what's wrong. Normally I should
be able to use the values from the config.php file, right?
greetz
<T!M> aka wEEdpEckEr
Comment