note 53937 rejected from control-structures.switch by betz
| From: | betz@php.net | Date: | Fri, 17 Jun 2005 17:13:37 +0000 |
| Subject: | note 53937 rejected from control-structures.switch by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-90592@lists.php.net to get a copy of this message | ||
Note Submitter: paralyzedsk8er at msn dot com
----
evenings,
i cannot seem to get my switches to work...
so far i have:
<?php
require_once "_db.php"; // Database Connection REQUIRED!!
# Functions ################################
function Show_home() {
global $db, $phpself;
$pagetitle = "Index"; // Define Page Title
include("_header.php");
// Home Stuff
echo "Home";
include("_footer.php");
}
function Show_servers() {
global $db, $phpself;
$pagetitle = "Server List"; // Define Page Title
include("_header.php");
// Server List
echo "Servers";
include("_footer.php");
}
function Show_team() {
global $db, $phpself;
$pagetitle = "Our Team"; // Define Page Title
include("_header.php");
// Current Team from DB
echo "Team";
include("_footer.php");
}
function Show_form() {
global $db, $phpself;
$pagetitle = "Request a Form"; // Define Page Title
include("_header.php");
// Request From
echo "Form";
include("_footer.php");
}
#########################################
# Switch ###################################
switch ($mode) {
case "ShowTeam":
Show_team();
break;
case "ShowServers":
Show_servers();
break;
case "ShowForm":
Show_form();
break;
default:
Show_home();
break;
}
#########################################
?>
was wondering if anyone knew why it wont work -- this will probs be deleted, but oh well. i must
try.
it will output the default, but not the rest.
thanks,
Steve-o
[index.php?mode=$var]