note 31447 added to function.include-once

From: Date: Tue, 22 Apr 2003 15:24:01 +0000
Subject: note 31447 added to function.include-once
Groups: php.notes 
Request: Send a blank email to php-notes+get-46931@lists.php.net to get a copy of this message
When I first began using include files, I continued to run across a peculiar problem, which I need to work out more and verify. Whenever you attempted to include a file which contained PHP functions, the included file would not know exactly what page it was. For example, # A.php function Print_PHP_Self () { print $_SERVER["PHP_SELF"]; } # B.php include_once "./A.php"; // This would result in A.php printing out "B.php" In order to get around this, I found out that if you use a complete file path to the file in which you want to include, then it will recognize itself properly. Once again, I need to do more testing to verify this again, but wanted to see if anyone had any experience with this problem. Best regards, Andy -- http://www.php.net/manual/en/function.include-once.php http://master.php.net/manage/user-notes.php?action=edit+31447 http://master.php.net/manage/user-notes.php?action=delete+31447 http://master.php.net/manage/user-notes.php?action=reject+31447

« previous php.notes (#46931) next »