RE: [PHP] Getting name of the main file from external included sc ript..

From: Date: Tue, 13 Mar 2001 14:25:57 +0000
Subject: RE: [PHP] Getting name of the main file from external included sc ript..
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-43834@lists.php.net to get a copy of this message
Hey! I already tried many ways. I also tried using $PHP_SELF. It returned the included script and not the main script (I echo'ed it to screen in order to be sure). The main file(main.php3) has an inclusion similar to the next one: <?php
    include("http://$SERVER_NAME/scripts/ext.php3?LayoutDir=/layout/&LayoutNum=1");
?> What do you offer me to do? Thank you in advance - Aviv Revach At 16:53 13/03/01 -0700, Johnson, Kirk wrote:
Aviv, I'm not quite sure what you are asking. If you are just doing an include() or a require() on a chunk of code, then I think the usual server variables will give you the path of the main file, e.g. $PHP_SELF. If you are doing a *redirect* to a *different page*, then you could look at $HTTP_REFERER, or pass the main page name as a GET attached to the URL. Hope this helps. Kirk -----Original Message----- From: Aviv Revach [mailto:aviv_r@brillianet.com] Sent: Monday, March 12, 2001 4:15 PM To: php-general@lists.php.net Subject: [PHP] Getting name of the main file from external included script.. Hey! I already asked this once before, but nobody seems to answer. That's why I'm re-writing my question.
     I have a main file named: "main.php3"
     It includes an external php3 script named: "ext.php3"
Inside of the 'ext.php3' script - I need to know the full path of the file which included it (in this case - 'http://www......./dir1/dir2/main.php3'). How could I do that? Thank you in advance - Aviv Revach
     BRILLIANeT Website -
http://www.brillianet.com/ -- 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 -- 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
XOR-Coders Mega Programming Resource Site! -
        http://members.xoom.com/xorcoders/


« previous php.general (#43834) next »