jamesxg1 Posted May 20, 2009 Share Posted May 20, 2009 how do i make if so that if a $_GET is empty it will auto reffer to this Profile.php?memberid=$member i need the var to work aswell but i havent the slightest on how to do this apart from the empty() function, but that in my eyes is very unreliable and to many lines when i could have it on one lol Quote Link to comment Share on other sites More sharing options...
Ken2k7 Posted May 20, 2009 Share Posted May 20, 2009 Well if you really don't want to use empty, you can do this - if (!$_GET['something']) { header('Location: /Profile.php?memberid='.$member); } Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted May 20, 2009 Share Posted May 20, 2009 Ken, you really ought to be checking to see if it was set first. Quote Link to comment Share on other sites More sharing options...
Ken2k7 Posted May 20, 2009 Share Posted May 20, 2009 PHP is a loose language. I really ought to have a boolean condition. It's like using if ('') instead of if (empty('')). :-\ Both works. IMO, the former shouldn't. Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted May 20, 2009 Share Posted May 20, 2009 Yes, php is a loose language. And yes, the above will work. But only if notices are turned off. Which you cannot guarantee. 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.