You can try...
echo $GLOBALS[PHP_SELF];
or
echo $_SERVER[SCRIPT_FILENAME];
You'll need to do a string replace to get exactly what you want.
If you ever want to see what's happening behind the scenes with these variables... try pasting this at the end of your script. I keep this in it's own file and include as necessary for debugging.
function myinfo($array)
{
echo "<pre>";
print_r($array);
echo "</pre>";
}
myinfo($GLOBALS);
myinfo($_SESSION);
Cheers,
TS