I'm trying to have a number of forms with one field each and make the input enter in to the same array.
This is my code:
<?php
$parts = array();
for($i = 0; $i < "10"; $i++)
{
echo '<form action="index.php" method="post">';
echo '<input type="text" name="parts[]"><br>';
echo '<input type="submit">';
echo '</form>';
$parts[$i] = $_POST['holder'];
unset($_POST['holder']);
}
$arrlength = count($parts);
for($i = 0; $i < $arrlength; $i++) {
echo $parts[$i];
echo "<br>";
}
?>
As of right now the number I choose at random was 10 it's supposed to be any given number by the user, but this is just for test purposes.
The problem I'm having is that it only posts the last part, I've tried a bunch of different ways but none have been successful so far.