delphi123 Posted December 11, 2007 Share Posted December 11, 2007 I have the following line to open an if - basically I'm checking that the user DOES have an id set and that they HAVEN'T got a cookie. if (isset($_GET['id'])&& isset($_COOKIE[$software_cookie])) How can I change the above statement so it does this? Quote Link to comment Share on other sites More sharing options...
adam291086 Posted December 11, 2007 Share Posted December 11, 2007 if (isset($_GET['id'])&& !isset($_COOKIE[$software_cookie])) I think that will work. Feel free to correct me anyone i am still on the steep learning curve of php. Quote Link to comment Share on other sites More sharing options...
Lumio Posted December 11, 2007 Share Posted December 11, 2007 You mean, that you want to ask if it is not set? Like that: <?php if (!isset($var) && !isset($var)) { //code... } //or if (isset($var) === false && isset($var) === false) { //your code } ?> Quote Link to comment Share on other sites More sharing options...
themistral Posted December 11, 2007 Share Posted December 11, 2007 isset checks to see if something is set and !isset checks something is not set Quote Link to comment Share on other sites More sharing options...
delphi123 Posted December 11, 2007 Author Share Posted December 11, 2007 perfect! learn something every time! Quote Link to comment Share on other sites More sharing options...
Lumio Posted December 11, 2007 Share Posted December 11, 2007 3 posts and all the same. hmm... okay You can also use empty. But empty is a little bit different... var_dump( empty("0") ); var_dump( empty("") ); both are 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.