Jump to content


This topic is now archived and is closed to further replies.


Config.php Loading but Vars not.

Recommended Posts

Hey, Ok I have working on a website, and i have the config file with all my variables written out but when i Require it into my page just before the <html> tag, and im not getting any errors, but later down in my page when i call for any of my variables from the config.php, they dont come up, its like the vars are empty.. oh wait and i will run a script....

echo "<title>abydos2</title>";
If (isset($dbhost)){
echo "$sitename" ;
else if (empty($sitename)) {
echo "The var is empty";
} else {
echo "The if turned out bad" ;
and i got the result that the var is empty?
Why does that happen if the var is set within the file being required?

And while on the topic of config files, On GNU software, like phpBB and SMF, they both have a config.php or settings.php with all the database variables to be included, but with the file permissions set to 777, doesnt that mean anyone can include the file? isnt that unsafe that anyone could require the file from anyones forum and read the variables with the database info? isnt that really unsafe, sorry they probs have some security in place, n00b question.


Share this post

Link to post
Share on other sites
That's because you entered the full path:

If you want the vars to also included enter the short path:


Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.