lorne17 Posted November 26, 2008 Share Posted November 26, 2008 Is there a way to create a title that automatically places the name of the folder the page is located in? I have a header when a client logs in and views available files to download, and would like to get the header to be the title of the folder they are currently in. Does that make sense? Any help would be greatly appreciated. Thanks, Lorne Link to comment https://forums.phpfreaks.com/topic/134314-solved-code-to-have-header-the-name-of-folder/ Share on other sites More sharing options...
ShiloVir Posted November 26, 2008 Share Posted November 26, 2008 by Header do you mean <title>? if so this code will work: <title><?php echo $_SERVER['PHP_SELF']; ?></title> Link to comment https://forums.phpfreaks.com/topic/134314-solved-code-to-have-header-the-name-of-folder/#findComment-699248 Share on other sites More sharing options...
phpSensei Posted November 26, 2008 Share Posted November 26, 2008 <title><?php echo basename(dirname(__FILE__)); ?></title> Link to comment https://forums.phpfreaks.com/topic/134314-solved-code-to-have-header-the-name-of-folder/#findComment-699253 Share on other sites More sharing options...
lorne17 Posted November 26, 2008 Author Share Posted November 26, 2008 Awesome, worked like a charm. Here's the code: <span class="heading_text"> <?php echo basename(dirname(__FILE__)); ?> </span> I didn't want it in the title, But I did want it as a heading and it still worked great. Thanks again, Lorne Link to comment https://forums.phpfreaks.com/topic/134314-solved-code-to-have-header-the-name-of-folder/#findComment-699294 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.