I am trying to set a if statement(s) for a self-processing form that checks if the user entered a positive whole number for quantity. This would be the following conditions:
is_numeric
is_int
and > 0
I've read that I can use || and && to set multiple conditions in a single if function, however it's not working because when I typed "-1" or "jkgh" as quantity, it still printed the table row.
If statement:
if (is_numeric($_POST['qty_entered'][0]) || is_int($_POST['qty_entered'][0]) || $_POST['qty_entered'][0] > 0) {
print "'<tr><td>' test '</td>'";
Thanks!
||stands for OR,&&stands for AND. Once you know that, just try to phrase your conditions and replace with appropriate symbols