objnoob Posted November 13, 2010 Share Posted November 13, 2010 For some reason the line commented // executes unexectedly does exactly that Any ideas why? if ($_POST['user'] == null){ $errors[] = 'An Interviewer ID is Required'; }elseif ($_POST['task'] != 'receipting' || $_POST['task'] != 'dataentry'){ $errors[] = 'Invalid Task'; // EXECUTES UNEXPECTEDLY } if (!empty($errors)){ print_LoginForm($errors); } echo "</b><select name='task'>\n"; echo "<option value='receipting'>Receipting</option>\n"; echo "<option value='dataentry'>Data Entry</option>\n"; echo "</select>\n"; Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted November 13, 2010 Share Posted November 13, 2010 Assuming that $_POST['task'] must equal either 'receipting' or 'dataentry', change || to &&. Quote Link to comment Share on other sites More sharing options...
objnoob Posted November 13, 2010 Author Share Posted November 13, 2010 Heh. My first idea was to check whether it == 'receipting' || == 'dataentry', but then I decided to check whether it != and managed to get my operator thought process screwed. Thanks Pika 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.