After reading the manual entry on $_SERVER predefined variables, I'm unclear on the difference between 'SCRIPT_FILENAME' and 'PATH_TRANSLATED'.

Results from a test script, run from a few different locations on my webserver, were always the same for these two variables.

I'm especially confused by the "Filesystem- (not document root-) based path" comment for 'PATH_TRANSLATED'.


On a pseudo-related topic: what should you use to find the absolute path from root to your application directory when you need to include a file? For example, I'm writing an application that has a function library in 'app/lib/'. From any file in the application, at any directory level, I want to be able to include specific files from the library.


What's the best way to find '/absolute/path/from/root/' from '/absolute/path/from/root/app/*/any_file.php'?

Since the path you get from 'DOCUMENT_ROOT' isn't necessarily where the executed file is (e.g., user directories), should that be avoided for this type of task?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to