Why doesn't this require_once statement find the file? (PHP)
- by ggfan
I not sure what's going on..maybe I missed something simple.
In my connectvars.php file, I connect to the database using the variables in my config.php folder.
Here's the hierarchy:
admin(folder)
config.php
includes(folder)
connectvars.php
I want to get information from config.php to use in connectvars.php, so I use:
require_once("../admin/config.php");
But everytime I do this I get Warning: require_once(../admin/config.php) [function.require-once]: failed to open stream: No such file or directory in /home/a8879415/public_html/includes/connectvars.php on line 2
BUT when I type: require_once("admin/config.php");, it works.
I thought I had to go up a level, then go down to admin, then get config.php. So how come I just need to go into the admin folder then get config.php?