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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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