bach Posted October 4, 2006 Share Posted October 4, 2006 Hello,The following code is an example of the menu code contained on all the fundraising pages.[code]<ul><li><a href="../index.xhtml">Home</a></li><li><a href="../about/about.xhtml">About</a></li><li>Join Us</li><li>Outreach</li><li>News & Events</li><li><a href="fund.xhtml">Fundraising</a></li><ul><li><a href="campaigns.xhtml">Current Campaigns</a></li><li>Help Us Raise Funds</li><li>Donations</li> </ul><li>Contact Us</li></ul>[/code]My question is that on each page with a sub-menu like Fundraising I need to change the menu/sub-menu. Is it possible for me to write the whole menu and sub-menus and use php to check which submenus should be shown?Bach Link to comment https://forums.phpfreaks.com/topic/23018-menu-advice/ Share on other sites More sharing options...
tleisher Posted October 4, 2006 Share Posted October 4, 2006 You could do something like this:[code]<?php$fund = $_GET["fund"];?><ul><li><a href="../index.xhtml">Home</a></li><li><a href="../about/about.xhtml">About</a></li><li>Join Us</li><li>Outreach</li><li>News & Events</li><li><a href="fund.xhtml">Fundraising</a></li><?phpif($fund == "raiser_1"){?><ul><li><a href="campaigns.xhtml">Fund Raiser #1</a></li><li>Help Us Raise Funds</li><li>Donations</li> </ul><li>Contact Us</li></ul><?php} else if ($fund == "raiser_2"){?><ul><li><a href="campaigns.xhtml">Fund Raiser #2</a></li><li>Help Us Raise Funds</li><li>Donations</li> </ul><li>Contact Us</li></ul><?php}?>[/code]Then use the URL: yoursite.php?fund=raiser_1 or yoursite.php?fund=raiser_2.. etc. Link to comment https://forums.phpfreaks.com/topic/23018-menu-advice/#findComment-103955 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.