if you want to change your include path on the fly you can use the
[man]ini_get/man and [man]ini_set/man methods
here is a trick i've use
[edit]
sorry before editing i tried to use the basedir function instead of dirname, and bsaedir does not exist
[/edit]
<?php
/// BASE_INCLUDE.PHP this file put in the base directory of your site
ini_set( 'include_path', ini_get('include_path') .":". dirname(__FILE__) );
?>
# SOME SCRIPT:
<?php
require '../relative/path/to/bottom/directory/base_include.php';
?>
you need to know the relative path to this sites root, and now the script will take care of altering the inlude path to have that base directory... this may or may not be helpful to you depending on what you are trying to do
[edit]
the FILE points to the path of the actual file you are in ... not the top file including it... so this lets you program your includes around only knowing where your base directory is so you can throw the scripts between sites with different base paths and not need to make any changes
if you have access to the php.ini file in the first place you can get rid of the naughty relative call on each page by taking advantage of the auto_prepend option, and still reap the rewards if you have both systems set to use the same auot_prepend