Friday, February 12, 2010

Programmer - PHP Switch Nav system - how can i set it up to use 2 GET variables

Programmer Question

I use a the following PHP switch for my navigation menu:



<?php include("header.php"); 
if (! isset($_GET['page']))
{
include('./home.php');

} else {
$page = $_GET['page'];
switch($page)
{
case 'about':
include('./about.php');
break;
case 'services':
include('./services.php');
break;
case 'gallery':
include('./gallery.php');
break;
case 'photos':
include('./photos.php');
break;
case 'events':
include('./events.php');
break;
case 'contact':
include('./contact.php');
break;
}
}
include("footer.php");
?>


When I go to my "Photos" section, I am going to have a sublist for other galleries within the photos.



When I am on a page right now, my url looks like this:



index.php?page=photos


I would like to know what PHP code I need to add so when i go to the CARS section I can have my url look like this:



index.php?page=photos&section=cars


?

No comments:

Post a Comment

LinkWithin

Related Posts with Thumbnails