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. 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' ) { 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 } 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
Archived
This topic is now archived and is closed to further replies.