Changing the test from AND (
&&
) to OR (<coe rde="">||) your loop is still incorrect. If one item in the row contains the correct Zipcode then you will report the input as correct. But you have not checked that both correct fields exist in the same row. As I explained in your previous question at
Csv check breaks the whole whole code?[
^], you need to access both fields at the same time and test them together, thus:
while (($row_data = fgetcsv($file_handle)) !== FALSE) {
if ($row_data[0] == $Zipcode && $row_data[1] == $Housenumber && $row_data[2] == $Toevoeging)) {
$_SESSION['input_found'] = "user input found";
}
}
Go back to my previous answer and follow the link to the PHP manual where array access is explained.