I'm having troubles getting this if statement to work properly. I wan't the POST field "reference_nr" to be able to contain an empty value or numeric value. This is my code:
if(!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/",$_POST['faktura_email'])||
!is_numeric($_POST['skadesnummer'])||
!is_numeric($_POST['faktura_aar'])||
(strlen($_POST['faktura_aar']) > 4)||
!is_numeric($_POST['faktura_nr'])||
(strlen($_POST['faktura_nr']) > 3)||
!is_numeric($_POST['debitor'])||
!is_numeric($_POST['reference_nr'])){
print "Query fail";
} else {
print "Query success";
}
I'll hope you understand my question. Have a nice day :)