AbydosGater Posted September 16, 2006 Share Posted September 16, 2006 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 Quote Link to comment Share on other sites More sharing options...
Orio Posted September 16, 2006 Share Posted September 16, 2006 That's because you entered the full path:require("http://abydosgaters.com/beneavin/config.php");If you want the vars to also included enter the short path:require("config.php");Orio. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.