943,169 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Marked Solved
  • Views: 32
  • PHP RSS
Aug 31st, 2010
0

How do I get the top-of-the-tree directory?

Expand Post »
Hi there, I'm trying to get the root directory of my site... But I don't want to edit the dots with slashes every time I make a new page in a directory inside another directory.. Any ideas? Here's an example tree :-)

-/
-/stuff
--/stuff/lol.php
-/lolwut
--/lolwut/cake.php
--/lolwut/pie.php
Similar Threads
Reputation Points: 10
Solved Threads: 2
Light Poster
GigsD4X is offline Offline
31 posts
since May 2010
Sep 1st, 2010
1
Re: How do I get the top-of-the-tree directory?
$_SERVER['DOCUMENT_ROOT'] will give you the root address.
Reputation Points: 210
Solved Threads: 228
Nearly a Posting Virtuoso
chrishea is offline Offline
1,389 posts
since Sep 2008
Sep 3rd, 2010
0
Re: How do I get the top-of-the-tree directory?
Hmm.. It appears that didn't work, so I used $_SERVER["SERVER_NAME"], and it started working! Anyway, thanks for the help
Reputation Points: 10
Solved Threads: 2
Light Poster
GigsD4X is offline Offline
31 posts
since May 2010

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: encryption help at login
Next Thread in PHP Forum Timeline: how can i make php alert pop ups just like in javascript.





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC