I’m working on a “bread crumbs” type link system that will appear at the top of my pages. For example, it might display something like this:
Home > World > North America > U.S. > Alaska
The primary code is in an include page and looks something like this:
’ . $seclink . ‘’ . $contlink . ‘’ . $natlink . ‘’ . $statelink . ‘’ . $myname . ’
($sec, $cont, $nat and $state stand for Section, Continent, Nation and State.)
I put the corresponding echo functions in the head section of each page, with upper hierarchy pages getting less. For example, I only need $seclink on North America’s home page, while a state page (like Alaska) needs $seclink, $contlink and $natlink.
But I realized that life would be a lot simpler if I just stuck all the echo functions in another include page. The only problem is that now all four links show up on every single page.
So, to cut to the chase, what are some strategies I could use to exclude certain links from certain pages? For example, how would I bar $statelink from every “nation” page? How would I bar $natlink and $statelink from every continent page?
$seclink = ‘’ . $mysec . ’ > ';
$contlink = ‘’ . $mycont . ’ > ';
$natlink = ‘’ . $mynat . ’ > ';
$statelink = ‘’ . $mystate . ’ > ';