ItsWesYo Posted June 14, 2008 Share Posted June 14, 2008 Look at attached graphic to help. ---------- I'm looking for an easier way to make a "bread crumbs" type thing. EXAMPLE: about.php haha.php test.php I was trying to be hopeful to make a page called "variables.php" or "youarehere.php". On that page, I would put would put: about.php -> "Home > About" haha.php -> "Home > Haha" test.php -> "Home > Test" After that, I could include "variables.php" or whatever on the layout, and when that page comes up, it would go into variables.php and look for that page and give out what it says. I might have to show you the whole layout code (header.php, footer.php) if you need it. [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/110164-i-think-variables/ Share on other sites More sharing options...
hansford Posted June 14, 2008 Share Posted June 14, 2008 sounds complicated. why not just check what page you're on and then include or echo out. But then again, maybe I'm not following you. <?php $page = $_SERVER['REQUEST_URI']; switch($page){ case '/page1.php': include('whatever'); echo 'whatever'; break; case '/page2.php': include('whatever'); echo 'whatever'; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/110164-i-think-variables/#findComment-565365 Share on other sites More sharing options...
Guest Xanza Posted June 14, 2008 Share Posted June 14, 2008 the php switch is definitely the more practical way, but i like to use $_GET so I can customize my own urls. <?php /* usage will be http://site.com/navagation.php?p=contact => contact.php */ $page = $_GET['p']; if($page == 'home'){ include('index.php'); } if($page == 'contact'){ include('contact.php'); } if($page == 'about'){ include('about.php'); } if($page == 'prices'){ include('prices.php'); } if($page == 'quote'){ include('quote.php'); } ?> but that won't help you for breadcrumbs, however this will: http://www.evolt.org/article/Breadcrumbs_for_PHP_Lovers/17/4455/ Quote Link to comment https://forums.phpfreaks.com/topic/110164-i-think-variables/#findComment-565379 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.