I think i might have an answer to what you are after. There are two parts to the problem.
1) Determining the directory in which the script is running, this can be done from the php enviroment variables
// get the path info (note i am not sure this is the right env var)
$strFilePath = get_env( PATH_INFO );
2) Deconstructing the directory information and turning it the string and links you are after.
// split the directory into directories (place into an array)
$arrDirectoryList = explode( '/', $strFilePath );
// output the Home Text
echo "Home";
// Get the number of directory levels
$intNoLevels = count( $arrDirectoryList );
// now output the directory information
for ( $intCurrDir = 0; $intCurrDir < $intNoLevels; $intCurrDir++ )
{
// get the directory name
$strCurrentDirectory = $arrDirectoryList[ $intCurrDir ];
// build the link
$strLink = '';
for ( $intCount = 1; $intCount <= $intNoLevels; $intCount++ )
{
$strLink .= '../';
}
echo " >> ";
echo <a href="' . $strLink . 'destination.php">';
echo $strCurrentDirectory . '</a>';
}
I think this is about all (if there are any problems let me know)
Cheers,