[PHP] HELP: Detecting the name of the file a function is being called from

2004-02-09 Thread Samuel Ventura
Hi there I have 2 scripts: ?php /* test1.php */ function called_from_file(){ print __FILE__ } ? /// ?php /* test2.php */ include(test1.php); called_from_file(); ? / I get the output test1.php

[PHP] HELP: Nested include(...)'s take relative paths not intuitively

2004-02-10 Thread Samuel Ventura
Hi there, I have 3 files in nested subdirectories (1) /test.php (2) /subdir1/test.php (3) /subdir1/subdir2/test.php (1) contains // ?php print hello; ? (2) and (3) contains / ?php include(../test.php); ? if I call (3) it loops forever in (2) trying to

Re: [PHP] HELP: Nested include(...)'s take relative paths not intuitively

2004-02-11 Thread Samuel Ventura
Hi there again people, I looks like this thread turned into a 'include' usage discussion. Well, nothing wrong with that. The conclusion seems to be that ALL level of nested included inherit current directory reference for relative paths from the very first script ( that in $_SERVER[SCRIPT_NAME]