Hi , i've fixed my problem , using a combination of the dirname() and str_replace() functions.
Inelegant maybe, but it works!
*CODE SNIPPET**********************
// get the current directory
$current_dir=getcwd();
// dirname returns the next directory up
// a level
$previous_dir = dirname ($current_dir);
// now replace the section of the $previous
// dir string with a base URL
// in my case currently "http://localhost"
$previous_url = str_replace("/home/sites/site2/web",$base_url,$previous_dir);
// THUS if the current directory is
// /home/sites/site2/web/documents/france/mag// azines, my BACK button url would point now
// to http://localhost/documents/france
// this displays a "BACK" icon , which
// takes you back up the directory tree
$image_url="/icons/backicon.gif";
echo "<tr>
<td bgcolor='#FFFFF0' font face='arial' size='2'>
<a href=\"$previous_url\">
<img src=$image_url></a>";