I have the following HTML form, which is being generated dynamically from a table in a MySQL database.
<form method="post" name="chapters" action="ChaptersUpdate.php">
<input type='text' name='id' value='{$row['id']}'>
<input type='text' name='name' value='{$row['name']}'>
<input type='password' name='password' value={$row['password']};>
<input type='submit'>
</form>
I am looking for a way to make it such that when the form is submitted, the following data structure gets passed in $_POST:
[chapter] => Array
(
[0] => Array
(
[id] => corresponding chapter ID
[name] => corresponding chapter name
[password] => corresponding chapter password
)
[1] => Array
(
[id] => corresponding chapter ID
[name] => corresponding chapter name
[password] => corresponding chapter password
)
)
I tried various combinations of name='chapter[][id]' / name='chapter[][name]' / name='chapter[][password]' with little success. The array data structure never looks like what I want it to look like.
Any ideas?