I have a form which setup looks similar to this:
<form action = "test.php" method="post">
<input type="text" name="name" />
<textarea name="item[]" rows="4" cols="90" maxlength="500" ></textarea>
<input id="submitButton" type="submit" name="submit" class="submit action- button" value="Verzenden" ></textarea>
</form>
Now I have a button also on the same page on which the form resides, which executes a jquery function. This function adds an extra textarea (with name="item[]" to the form. So it could be that if the user clicks that button two times that I eventually have three textareas..
Now when user submits the form then it will go to another page: the test.php page. In this page I execute a PHP script in which I test if POST isset and then catch the POST values..
Now every user sees the $_POST['name'] value, but for the $_POST['item'] array, sometimes the array is empty(I saw that it was on mozilla firefox 51.0.1 browser).. even if they filled the textareas with text.. and they get the warning for this line(which is in the test.php script):
foreach($_POST['item'] as $item)
Strange, but does anyone recognizes these problem?