How do i find the calling file location?

0x802b

New Member
I am trying to locate the location of file being displayed in php.I have a small file which can be included by any file wither from root or from inside any folder.i need to print out the location of the.for long explanation: my config file is config.php located in root location of website i.e localhost/site1/test/. It contains \[code\]print $_SERVER['SCRIPT_NAME']\[/code\]. it is being included by index.php in root location and also by database.php inside the includes folder of root.I get two different result: [*]localhost/site1/test/, when i include config.php in index.php[*]localhost/site1/test/includes, when i include config.php indatabase.phpI would like to get localhost/site1/test in both cases. So what can be the choice instead \[code\]$_SERVER['SCRIPT_NAME']\[/code\]
 
Back
Top