Page 1 of 1

php include() and directory problems

Posted: Sun Jul 15, 2007 11:44 am
by sportsdude11751
hey..how do you manage your files on your web server..for example i was on my main directory and that's where I kept my index.php, so something like http://www.whatever.com/index.php, then on that page i have a link that takes me to another directory like.. http://www.whatever.com/SSide/registerUser.php . BUT, when I try and include("stuff.php"); on register user, It can't find it. So i changed to inclue("../direcName/fileName.php") and it worked, BUT - here's the problem, that file that I include, also includes a file, but it can't get to it because it's not in the right directory, and I can't put a ../ before it because it works if your in one directory but not the other..how could i fix that?

Posted: Sun Jul 15, 2007 11:50 am
by feyd
get_include_path() and set_include_path() may be of interest along with the PATH_SEPARATOR constant.

Posted: Sun Jul 15, 2007 12:20 pm
by sportsdude11751
thanks a lot!

should i use that for each site that for each site that includes outside the main directory?