note 96458 deleted from faq.using by danbrown

From: Date: Mon, 01 Mar 2010 16:01:17 +0000
Subject: note 96458 deleted from faq.using by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-166499@lists.php.net to get a copy of this message
Note Submitter: DABZSE ---- hello! I have a problem with switch.. here it is. in php5.2.6 working, but in php5.3.1 have a problem: <?php if (isset($_GET['id'])) { switch ($_GET['id']) { case "intro" : include_once ("intro.php"); break; case "guestbook" : include_once ("guestbook.php"); break; case "flash" : include_once ("flash.php"); break; case "contact" : include_once ("contact.php"); break; } } elseif (isset($_GET['page'])) { switch ($_GET['page']) { case "page01" : include_once ("page01.php"); break; case "page02" : include_once ("page02.php"); break; case "page03" : include_once ("page03.php"); break; case "page04" : include_once ("page04.php"); break; } } else { /* here is the problem with default include!! how can I fix it?? I'm tried some different ways, but not working correctly*/ switch ($_GET['id']) { default : include ("intro.php"); break; } } ?> so, when nothing is included, then write an error message (which in this script), but including the default value and I can view in offline mode.. thx

« previous php.notes (#166499) next »