twofivethreetwo Posted November 15, 2007 Share Posted November 15, 2007 Here is the setup. You visit http://teamname.domain.com which redirects to www.domain.com/teamname I need to get the folder name (teamname) into a variable in php. How would I do this? not the full path or anything like that. Basically the folder name is the name that I need to get info from the sql database. Link to comment https://forums.phpfreaks.com/topic/77518-solved-get-dir-name/ Share on other sites More sharing options...
MadTechie Posted November 15, 2007 Share Posted November 15, 2007 this should work.. *untested <?php echo trim(dirname($_SERVER['PHP_SELF']),"/"); ?> trim just removes the leading / but you could to it 101 other ways Link to comment https://forums.phpfreaks.com/topic/77518-solved-get-dir-name/#findComment-392388 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.