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 Quote Link to comment 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. Quote Link to comment 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.