Re: $_SERVER['PHP_SELF'] in a included file

From: Date: Mon, 26 Feb 2007 13:50:51 +0000
Subject: Re: $_SERVER['PHP_SELF'] in a included file
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-249442@lists.php.net to get a copy of this message
clive wrote:
A project that I work on has a index.php that includes other files depending on certain requirements. so index.php includes a.php; in a.php if you echo $_SERVER['PHP_SELF'] it echos index.php and I understand why it does this. But, I want echo the file name of a.php from a.php and I dont want to add a $filename='a.php'; at the top of a.php, although I have thought of using subversion and a find and replace to insert $filename="$Id$"; at the top of all the files. Does anyone know know of another way I can get a included files filename? Sorry if I have posted this question in the past, its been a while since I last thought of this problem.
__FILE__ will give you the path and filename of the current file. -Stut

« previous php.general (#249442) next »