For each? Loop? Many Form Fields with DB insert
Posted: Sun Mar 08, 2015 8:37 pm
...form data...
So basically I have it set up so on the click of a button I can add more fields to the current form. Example: Multiple drops (of items) from chopping a tree.
echo "<table><tr><td>Drops: <select name=\"input4-a[]\" id=\"items\">";
echo $items;
echo "</select> </td>";
echo "<td>[Chance: <input type=\"text\" name=\"input4-b\" style=\"width:80px;\" value=\"30 / 3000\"/> ]</td></tr></table>";
So its basically there so I can add many drops to the chopping a tree.
What I need is to collect the values from input4-a and input4-b so I can insert the data ($_POST[input4-a] & $_POST[input4-b]) into the drops table.
Any ideas?
So basically I have it set up so on the click of a button I can add more fields to the current form. Example: Multiple drops (of items) from chopping a tree.
echo "<table><tr><td>Drops: <select name=\"input4-a[]\" id=\"items\">";
echo $items;
echo "</select> </td>";
echo "<td>[Chance: <input type=\"text\" name=\"input4-b\" style=\"width:80px;\" value=\"30 / 3000\"/> ]</td></tr></table>";
So its basically there so I can add many drops to the chopping a tree.
What I need is to collect the values from input4-a and input4-b so I can insert the data ($_POST[input4-a] & $_POST[input4-b]) into the drops table.
Any ideas?