Preserved Topic: Get calling directory? |
|
---|---|
Author | Thread |
Paranoid (IV) Inmate From: New Jersey, USA |
posted 12-27-2001 03:37
Say I have a header.inc file that is used by pages in many other directories. Is there a way for me to tell which directory the page is from that is calling the header.inc file? I'm trying to avoid having to put the header file in every directory that calls it because I have to hard code file references in it. |
Paranoid (IV) Mad Scientist with Finglongers From: Germany |
posted 12-27-2001 09:26
try |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
posted 12-27-2001 10:28
Actually, since you need to find the folder where the file that's calling header.inc file is located, you'll need to use this: |
Paranoid (IV) Inmate From: Minneapolis, MN, USA |
posted 12-27-2001 17:40
Nice Typerius. Actually I noticed most of the variables dealing with the file ($REQUEST_URI, $SCRIPT_NAME, etc.) are for the requested file, not the included file. I hadn't yet needed to reference the included filename (especially since it can just be hard-coded into the file), but that is a handy tip nonetheless. |
Paranoid (IV) Inmate From: New Jersey, USA |
posted 12-27-2001 19:08
Your awesome as always mr.maX |