If you want the current path where youre file is and not the full path then use this :)
<?php
echo('dir = '.basename (dirname($_SERVER['PHP_SELF']),"/"));
?>
Example:
www dir: domain.com/temp/2005/january/t1.php
<?php
echo('dirname <br>'.dirname($_SERVER['PHP_SELF']).'<br><br>');
?>
<?php
echo('file = '.basename ($PHP_SELF,".php"));
?>
if you combine these two you get this
<?php
echo('dir = '.basename (dirname($_SERVER['PHP_SELF']),"/"));
?>
And for the full path use this
<?php
echo(' PHP_SELF <br>'.$_SERVER['PHP_SELF'].'<br><br>');
?>