When you have repeated names, you have to give them array-style names:
When you do this, $_POST['id']
, $_POST['latitude']
, and $_POST['longitude']
will be arrays containing the values.
Your form processing code can then iterate over these:
for ($i = 0; $i < count($_POST['id']); $i++) {
if (isset($_POST['latitude'][$i], $_POST['longitude'][$i])) { // Make sure both are filled in
// Do stuff with this row of the form
}
}