![]() Preserved Topic: Get calling directory? (Page 1 of 1) |
|
---|---|
Paranoid (IV) Inmate From: New Jersey, USA |
![]() 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 |
![]() try |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
![]() 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 |
![]() 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 |
![]() Your awesome as always mr.maX |