ewwharhar Posted March 10, 2007 Share Posted March 10, 2007 Hi, I am trying to insert a phrase into my site title and I only want it to show on every page but the homepage. How do I do this? Link to comment https://forums.phpfreaks.com/topic/42073-show-on-other-pages-but-not-homepage/ Share on other sites More sharing options...
pocobueno1388 Posted March 10, 2007 Share Posted March 10, 2007 You need to make a layout file and include it on all your scripts but your homepage that includes the title you want. Link to comment https://forums.phpfreaks.com/topic/42073-show-on-other-pages-but-not-homepage/#findComment-204076 Share on other sites More sharing options...
tippy_102 Posted March 10, 2007 Share Posted March 10, 2007 <?php $realname = basename($_SERVER[sCRIPT_FILENAME], ".php"); if ($realname == 'index') { echo "No catchy phrase here!"; } else { echo "Catchy phrase that doesn't display on the index page."; } ?> Link to comment https://forums.phpfreaks.com/topic/42073-show-on-other-pages-but-not-homepage/#findComment-204081 Share on other sites More sharing options...
pocobueno1388 Posted March 10, 2007 Share Posted March 10, 2007 tippy_102 Definitely wins over my way =D Link to comment https://forums.phpfreaks.com/topic/42073-show-on-other-pages-but-not-homepage/#findComment-204127 Share on other sites More sharing options...
ewwharhar Posted March 10, 2007 Author Share Posted March 10, 2007 nvm. delete Link to comment https://forums.phpfreaks.com/topic/42073-show-on-other-pages-but-not-homepage/#findComment-204128 Share on other sites More sharing options...
per1os Posted March 10, 2007 Share Posted March 10, 2007 The funny thing is, my buddy asked me the same question and I fixed it for phpArcade. Fun stuff, I cannot remember how I fixed it, but I know I sure did, let me look around for that fix. //EDIT: here we go: <?php // End of the index.php file $pagetitle = "Thank Your For Your Submission"; $pagekeywords = $site_keywords; $pagedescription = $site_desc; } else { $_SESSION['index'] = true; // add this line!!!! $includefile = "./includes/main.php"; $pagetitle = "Title Here"; $pagekeywords = $site_keywords; $pagedescription = $site_desc; } } ?> In the overall.html file <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <?php if ($_SESSION['index']) { $display = $pagetitle . " - " . $site_title; }else { $display = $pagetitle; } unset($_SESSION['index']); ?> <title><?=$display;?></title> If you are using the phpArcade this should work just fine. Questions let me know. --FrosT Link to comment https://forums.phpfreaks.com/topic/42073-show-on-other-pages-but-not-homepage/#findComment-204131 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.