Hi, i hHi have some form validation on a small page i have. It checks that the fields A, B, C & D are are not empty. However i want to have validation on the D field to make sure that only the values 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 are allowed only and not 11, 12... or not 01, 02... - only the scores 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 Here is the code i have now: set_flashIf( empty($_POST['everyhit']), 'Ooops... Please fill in the everyhit field'); set_flashIf( empty($_POST['birthday']), 'Ooops... Please fill in the birthday field'); set_flashIf( empty($_POST['youtube']), 'Ooops... Please fill in the youtube field'); set_flashIf( empty($_POST['rate']), 'Ooops... Please fill in the rate field'); redirectIf(flash_exists(), 'moderator/index.php?'. $_SERVER['QUERY_STRING']); PHP: Can someone please add on the code needed for this please as i need to fix it urgently, thanks for your help
How about somthing like $field = (int) $_POST['rate']; if ($field < 1 || $field > 10 ) { echo("error"); }