Strange to me how a switch case structure works for all switch elements but the last 3.
I have a switch case structure to include files for specific pages. All seem to work but the last 3.
[B]What I’ve tried:
[LIST][*]
removing elements in the Switch Case
changing GET value to load page
changing order of switch case elements
echo values for GET on page loads
check for syntax errors
check the page to load is working correctly on its own
[B]Testing Results
When echoing the value of the $_GET showed a value while the ones which didn’t work didn’t show anything.
Example:
[code=php]$pgnm=$_GET[“pg”];
//print out the value of the $_GET
echo $pgnm;
switch($pgnm){
// result = Page1
case “Page1”:
include(“inc/page1.php”);
break;
// result = Page2
case “Page2”:
include(“inc/page2.php”);
break;
// result = **no value**
case “Page3”:
include(“inc/page3.php”);
break;
default:
include(“inc/page1.php”);
break;
}
If anyone has any ideas as to what would cause a malfunction like this, I’d appreciate your response.