root problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
user___
Forum Contributor
Posts: 297
Joined: Tue Dec 05, 2006 3:05 pm

root problem

Post by user___ »

Hi guys,
I have the following problem:
I have a forum which was set up in the web_root dir(Accessible by everyone).
But I decided to move my framework in an outer directory(One step up from my web_root).
I set in my config file $_SERVER['DOCUMENT_ROOT'] var which contains the root path but I need it one step above the web root and I do not know how do this. I can not use any replace functions due to the fact that my application must be portable. I mean that I want to include classes from the same config but the only problem is that when I call ini_set with the above variable($_SERVER['DOCUMENT_ROOT']) I do not go where I want to.
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Post by neophyte »

How about explode() the string on '/' and pop the top off with array_shift and rebuild?
user___
Forum Contributor
Posts: 297
Joined: Tue Dec 05, 2006 3:05 pm

Reply

Post by user___ »

As I said a time ago in the same forum "Sometimes, the simplest things are far away from my mind.".
Thank you.
Post Reply