PHP Switch Issues
Posted: Wed Jul 20, 2011 6:28 pm
I am trying to have multiple sections of a page using PHP by using two switch commands. So the link to get there is however when I go there all I see is my NOCODE case instead of the content. THe code is below:
thanks in advance
the URL for all of this is at http://beta.somethinghandy.com/code?lang=css
Code: Select all
?lang=css&code=lightboxCode: Select all
<?php
$lang=$_GET['lang'];
if($lang==""){$lang="none";}
switch($lang){
case "none":
@include('lang/none.php');
break;
case "html":
@include('lang/html.php');
break;
case "css":
@include('lang/css.php');
break;
}
?>
<hr />
<?php
$code=$GET['code'];
if($code==""){$code="nocode";}
switch($code){
case "nocode":
echo "ERROR 700: <em>NO SCRIPT SELECTED</em>";
break;
case "lightbox":
@include('code/lightbox.php');
break;
}
?>
the URL for all of this is at http://beta.somethinghandy.com/code?lang=css