jwk811 Posted May 7, 2011 Share Posted May 7, 2011 i know theres a way but i just forget. i want to do a switch function. switch ($_GET['page']) { case 0: include 'page'; break; case 1: include 'page1'; break; case 2: include 'page2'; break; default: include 'page'; } ?> just like that but if there is no $_GET page i just want it to do the default. instead of doing if isset GET page do switch else default page. i just want it to be simpler by doing something like switch(isset$_GET etc. Quote Link to comment Share on other sites More sharing options...
Zurev Posted May 7, 2011 Share Posted May 7, 2011 Why not just throw this at the top: $_GET["page"] = (isset($_GET["page"])) ? $_GET["page"] : "default"; That way it should just default to default unless you specified a case default. So you're pretty much setting $_GET["page"] if it isn't already. Quote Link to comment Share on other sites More sharing options...
jwk811 Posted May 7, 2011 Author Share Posted May 7, 2011 yes that was what i was looking for lol thank you Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.