paulman888888 Posted June 2, 2008 Share Posted June 2, 2008 If i use this gameid=$_GET['gameid'] and theres no gameid=something in the url what would be the value of it because i would like to make an IF statment. If gameid=$_GET['gameid'] doesnt exist then $gameid=0 else gameid=$_GET['gameid'] How could i make that. thankyou for all the help Link to comment https://forums.phpfreaks.com/topic/108414-solved-quick-question/ Share on other sites More sharing options...
trq Posted June 2, 2008 Share Posted June 2, 2008 <?php if (isset($_GET['gameid'])) { // do something. } ?> Link to comment https://forums.phpfreaks.com/topic/108414-solved-quick-question/#findComment-555784 Share on other sites More sharing options...
rhodesa Posted June 2, 2008 Share Posted June 2, 2008 $gameid = empty($_GET['gameid']) ? 0 : $_GET['gameid']; I would recommend using empty or isset, because if the url is: page.php?gamei= then isset will still validate to true Link to comment https://forums.phpfreaks.com/topic/108414-solved-quick-question/#findComment-555786 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.