grantf Posted May 13, 2008 Share Posted May 13, 2008 Hi all, am trying to get an if statement to evaluate 2 isset()'s at the same time with the following code, it doesnt seem to work. Does anyone know what i am doing wrong? if(!isset($_POST['var1']) && !isset($_POST['var2'])) Quote Link to comment Share on other sites More sharing options...
slpctrl Posted May 13, 2008 Share Posted May 13, 2008 That's checking to see if it is not set (the !'s). Donno if you meant to do this? ??? Otherwise there's nothing wrong with it. Quote Link to comment Share on other sites More sharing options...
haku Posted May 13, 2008 Share Posted May 13, 2008 Without knowing what it is you are trying to check, it's hard to say what your problem is. But here are some things you can check: - should you be using || instead of &&? - are the variable names spelled the same in your html form as they are in your script? - did you really mean to check to see if they weren't set, instead of if they are set? - is the action on your form set to 'get' instead of 'post'? Quote Link to comment Share on other sites More sharing options...
grantf Posted May 13, 2008 Author Share Posted May 13, 2008 thanks all... the problem was with one of the variable names cheers. 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.