loony383 Posted June 4, 2008 Share Posted June 4, 2008 how can i make $page = $_GET ; set $page to news if there is no page specefied on the url? Quote Link to comment Share on other sites More sharing options...
phpzone Posted June 4, 2008 Share Posted June 4, 2008 Short if: <?php $page = isset($_GET['page']) ? $_GET['page'] : 'news'; ?> Long if: <?php $page = ''; if ( isset( $_GET['page'] ) ) { $page = $_GET['page']; } else { $page = 'news'; } ?> 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.