Page 1 of 1
Help, conditional statement (if)
Posted: Sun Mar 21, 2010 6:02 am
by michaeru
Just curious, by using the if (or if..else) statement how will you do trap the values if the entered value is not one of the following 'add', 'edit', 'delete'.
Re: Help, conditional statement (if)
Posted: Sun Mar 21, 2010 7:02 am
by requinix
With an else block.
Re: Help, conditional statement (if)
Posted: Sun Mar 21, 2010 7:25 am
by michaeru
>.< well, yes. But I'm interested only on the "if the value sent is not equal to either add, edit or delete". I do not need the "if the value sent is equal to either add, edit or delete".
Re: Help, conditional statement (if)
Posted: Sun Mar 21, 2010 7:33 am
by ell0bo
do you mean...
if ( !($var === 'edit' || $var === 'save' || $var === 'delete') )
which is also...
if ( $var !== 'edit' && $var !== 'save' && $var !== 'delete )