I'm trying to build a template that dynamically adds menus based on the URL for example:
http://www.foofoo.com/index.php?page=Foo&menu=RightMenu
would resulte in the main content of the page being "Foo.php" and the menu would be "rightmenu.php".
I'm new to PHP, but have found some basic templating code that words well for my purposes, however, I can't seem to get it to work with two "switch" variables, I keep getting a parse error:
Here's the code:
<?php switch ($page) {
case "News": include ('admin/news/scripts/php-news.php'); break;
case "ContactUs": include ('contactus.php'); break;
case "Newsletters": include ('admin/newsletters/view_newsletter.php'); break;
case "ThankYou": include ('thankyou.php'); break;
case "Mail": include ('mail.php'); break;
case "Recommend": include ('recommend.php'); break;
default: include ('home.php'); } ?>
</td>
<td>
<?php switch ($menu) {
case "Knives": include ('menuknives.php'); break;
default: include ('rightmenu.php); } ?>
</td></tr></table>
Any help understanding the switch/case thing would be greatly appreciated. Thanks again, you guys rock.