As many do I have a config.php file in the root of a web app that I want to include in almost every other php file. So most of them have a line like:
require_on
Take a look at the function getcwd. http://us2.php.net/getcwd