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? Link to comment https://forums.phpfreaks.com/topic/108729-solved-when-somthing-blank-set-it-to-somthing/ 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'; } ?> Link to comment https://forums.phpfreaks.com/topic/108729-solved-when-somthing-blank-set-it-to-somthing/#findComment-557575 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.