Possible Duplicate:
Relative include files
For example,
include('../admin/db_cred.php');
That works if I am in another folder such as public. However if I am just at http://www.SITE.com/index.php, it does not work.
Warning: include(../admin/db_cred.php) [function.include]: failed to open stream: No such file or directory in /home/[…].php on line 6
I added the (dot dot slash) because searching ../ does not work very well…
The
../convention indicates to move up one directory level from where you are. If you are in the root directory, you cannot move up any more levels.If your /admin folder is in the root directory and you call this from the /public directory, then
../admin/would allow you to select the /admin folder from one level below