Re: absolute path of any PHP script?

From: Date: Sat, 06 Jan 2001 03:54:53 +0000
Subject: Re: absolute path of any PHP script?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-33011@lists.php.net to get a copy of this message
$PHP_SELF, I think... Put <?php phpinfo();?> in foo and then in bar and see what's available. ----- Original Message ----- From: Cynic <cynic@mail.cz> Newsgroups: php.general Sent: Friday, January 05, 2001 8:18 AM Subject: [PHP] absolute path of any PHP script? > how do I get the absolute path to any PHP script currently > being executed? > __FILE__ does not help here, because if I have > require( '../bar.php' ) ; > in foo.php, __FILE__ in foo.php will contain e. g. > 'c:/wwwroot/aaa/bbb/foo.php' (on windows), but in bar.php it > will contain '../bar.php' (e. g. the argument passed to > require()). > I know I could write a function to do this, but surely > there must be an easier way I just missed. > > TIA > > ____________________________________________________________ > Cynic: > > A member of a group of ancient Greek philosophers who taught > that virtue constitutes happiness and that self control is > the essential part of virtue. > > cynic@mail.cz > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#33011) next »