Here's one example...
<?php
switch($page){
// default is what will happen if page is empty
default:
echo "Welcome!";
break;
// what will be shown if page = login
case "login":
include("login.php");
break;
// what will be shown if page = logout
case "logout":
include("logout.php");
break;
}
?>
You would access those like this:
whateverurpagename.php?page=login
What variable goes after the ? depends on what you put in the ()'s after switch. If you want a switch inside of a switch you can do that as well. You would just access it like this:
whatever.php?page=login&action=login