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 Quote Link to comment Share on other sites More sharing options...
trq Posted June 2, 2008 Share Posted June 2, 2008 <?php if (isset($_GET['gameid'])) { // do something. } ?> Quote Link to comment 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 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.