xyn Posted August 8, 2006 Share Posted August 8, 2006 Hey,I have got my navigator on $_GET the problem with this is wheni call the exit; i lose everything else on the page below it. usuallymy copyright.I tried the following and it didn't work.[code=php:0]<?PHP$pg = $_GET['page'];if( !$pg ){ include("index.php"); break; } elseif( $pg == news ) { include("news.php"); break; } else { echo ' no such page'; break; } return;?>[/code] Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted August 8, 2006 Share Posted August 8, 2006 Remove the break; and the return; they are not needed. if you are using an if/elseif/else statment. However it'll be better if you use a switch:[code=php:0]$pg = isset($_GET['page']) ? $_GET['page'] : 'home';switch($pg){ case 'home': include 'index.php'; break; case 'news': include 'news.php'; break; case default: echo "no such page"; break;}[/code] Quote Link to comment Share on other sites More sharing options...
xyn Posted August 8, 2006 Author Share Posted August 8, 2006 cheers :] 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.