linus72982 Posted July 20, 2010 Share Posted July 20, 2010 If I explicitly redirect to blahblahetc.com/blahblah.php?id=myvalue, and then I use if $_GET['id'] = X on the page, it always returns true, am I using it wrong? Isset($_GET['id']... works, but not the other, how can I accomplish this correctly because I want to actually change id, not the entire variable name for each so I can use isset. Thanks ahead of time. Quote Link to comment https://forums.phpfreaks.com/topic/208339-am-i-missing-something-with-_get-and-typed-in-values/ Share on other sites More sharing options...
Pikachu2000 Posted July 20, 2010 Share Posted July 20, 2010 = is assignment. == is comparison. You want if( $_GET['id'] == 'X' ) { Quote Link to comment https://forums.phpfreaks.com/topic/208339-am-i-missing-something-with-_get-and-typed-in-values/#findComment-1088807 Share on other sites More sharing options...
waynew Posted July 20, 2010 Share Posted July 20, 2010 I don't think I fully understand your question. Say you redirect to blahblah.php?id=X if(isset($_GET['id']) && $_GET['id'] == "X"){ //true } else{ //false } Quote Link to comment https://forums.phpfreaks.com/topic/208339-am-i-missing-something-with-_get-and-typed-in-values/#findComment-1088808 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.