Don't let the title confuse you; I don't know what I'm doing.
I have a three part form (form1.php, form2.php, and form3.php) that I've been working on for most of my shift.
form1.php's job is to ask the user how many text fields of each type to create.
form2.php's job is to create the form as specified by form 1.
form3.php's job will be pull all that garbage and stick it in a db.
<!--
this form sends the value of $_POST['input1'] to form2.php
-->
<form method="post" action="form2.php">
<table>
<tr>
<td>input1</td><td><select name="input1"><option selected> - </option><?php
$i = 1;
while($i <= 100) {
echo "<option>$i</option>\n";
$i++;
}
?></select></td>
</tr>
<tr>
<td><input type="submit" value="submit"></td>
</tr>
</table>
</form>
Here's form2.php
<form method="post" action="form3.php">
<table>
<?php
$input1 = $_POST['input1'];
$i = 1;
while($i <= $input1) {
echo"<tr>\n<td><input type=\"text\" name=\"firstfield$i\"></td>\n
<td><input type=\"text\" name=\"secfield$i\"></td>\n
<td><input type=\"text\" name=\"thirdfield$i\"></td>\n";
$i++;
}
echo "<input type=\"hidden\" name=\"input1\" value=\"$input1\" />\n";
?>
<td><input type="submit" value="submit"><?td>
</tr>
</table>
</form>
form3.php
well, I have tried a number of methods to retreive the dynamic post data from form2.php that I don't even remember where I started. Every single tutorial I've read concerning multidiemensional arrays use predefined arrays, and do not include working with post data. If anyone would be so kind as to tackle this one, I'd appreciate it lots 🙂