Finding Out Document That Included Another File
| From: | Jeff Gannaway | Date: | Thu, 12 Jul 2001 15:46:31 +0000 |
| Subject: | Finding Out Document That Included Another File | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-57604@lists.php.net to get a copy of this message | ||
I have a PHP file that gets included by a lot of other files in a lot of
other directories. Among other things, this file needs to display a link
to that original page.
I know I could specify this in a variable in each original file before the
INCLUDE statement, but I'd like to do something more elegant and have the
INCLUDED file recognize the original file dynamically.
Is there some environmental PHP variable that has that info?
-- SAMPLE --
Filename: /dummy/BigFile.php
<?
include "../ImportantFile.php";
?>
Filename: /ImportantFile.php
<?
echo $ConstantThatShowsTheFileThatIncludedIt;
?>
Results:
/dummy/BigFile.php
Thanks,
Jeff Gannaway