RE: [PHP] $_SERVER['PHP_SELF'] in a included file

From: Date: Mon, 26 Feb 2007 14:20:03 +0000
Subject: RE: [PHP] $_SERVER['PHP_SELF'] in a included file
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-249449@lists.php.net to get a copy of this message
hi I'm afraid this is not available by default. You can try to parse the debug_backtrace() (see http://be2.php.net/manual/en/function.debug-backtrace.php) but this is probably too complex for online processing. if there are some native functions, please tell me !! Vincent Dupont Principal Consultant OpenSource Competence Center Ausy Belgium http://www.ausy.be -----Original Message----- From: clive [mailto:clive@rttc.co.za] Sent: Mon 2/26/2007 15:15 To: clive Cc: PHP General List Subject: Re: [PHP] $_SERVER['PHP_SELF'] in a included file Thanks Vincent,Stut and Olaf. Thats __file___ is exactly what I needed :) now for another brain teaser for your collective brains, How does a function know what file it was called from. a.php includes functions.php in a.php we call function test(); which is declared in functions.php Is there anyway for test(); to echo "called from a.php" with out passing 'a.php' or ___FILE___ as a parameter to the function? Im busy googling now for a answer. -- Regards, Clive. Real Time Travel Connections {No electrons were harmed in the creation, transmission or reading of this email. However, many were excited and some may well have enjoyed the experience.} -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#249449) next »