Jump to content

Config.php Loading but Vars not.


AbydosGater

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....

[code]<?PHP
require("http://abydosgaters.com/beneavin/config.php");
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" ;
};
?>[/code]
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.

#Thanks
#Abydosgater
Link to comment
https://forums.phpfreaks.com/topic/20961-configphp-loading-but-vars-not/
Share on other sites

Archived

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

×
×
  • Create New...

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.