Wonderful thank you, it displays a single / before the dir name but I can remove that without too much trouble :-) Thank you. Chris try $x =pathinfo($_SERVER['PHP_SELF']); echo $x['dirname']; =C= | | Cal Evans | http://blog.calevans.com | | Chris Payne wrote: > Hi everyone, > > > > I am using PHP_SELF in order to get the current path on a dynamically > created webpage. This gives me the following: > > > > /my_website/index.php > > > > My problem is, ALL I NEED is the directory name - no / or no index.php, how > can I strip these out to leave JUST the folder name the file is located in? > I need this because the page is dynamically created, and it gets templated > information from a database and needs to use the foldername as the > identifier between the DB entry to use for grabbing the information and the > pages inside the directory. > > > > Any help would be really appreciated and I'm certain it's something REALLY > obvious. > > > > Chris > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php