phat code "Good code isn't good design, and good design doesn't need good code." - Charlatan
Main

Projects

Downloads

Articles

Links

Forum

 

View Message

Back to Messages
Dav Fri Feb 9 2007 at 11:59 am
A little PHP help needed
 
 
I'm trying to get the full place (url) of where a running PHP script resides.  None of the ways in the PHP manual seem to do it correctly for me (at least not on my apache/php setup here at home).

When I have a script that is 'include'ing a script from another location it looks for files in *its* directory and not the directory where the included script is located.

For example, say I have /header.php script in my main directory which loads the stylesheet and various images for the site.  If I include that from within a deeper directory, I would do like '../header.php' but it looks for them in the deeper directory and not at the header.php directory.

I'd like to fix the header.php to look for the files in *its* directory and not from the other directories I may include it from.

Any advice is appreciated.  Even just telling me what PHP function to study on, that's fine.

- Dav
 
 
 
 

Reply to this Message

Name
Subject
Message

No HTML is allowed, except for <code> <b> <i> <u> in the message only.
All URLs and email addresses will automatically be converted to hyperlinks.