I am wondering if there is any guarantee on the order of the POST variables that I will see on the server side.
My use case: I have a form that the user will fill out to enter a list of names and letters. I use table rows, each of which has two inputs:
<table> <tr> <td><input type='text' name='name[]' /></td> <td><input type='text' name='email[]' /></td> </tr> <tr> <td><input type='text' name='name[]' /></td> <td><input type='text' name='email[]' /></td> </tr> </table>
The string can be cloned via javascript to allow the user to enter more names and letters, so I will not know in advance how many will be submitted.
On the server side, I see $ _POST ['email'] and $ _POST ['name'], but I'm wondering if I can safely assume that $ _POST ['email'] [0] will match $ _POST ['name' ] [0], $ _POST ['email'] [1] will match $ _POST ['name'] [1] and so on. Some basic tests seem to indicate yes, but I'm wondering if there is a guarantee or if I'm just lucky.
javascript html php forms
jhchen Sep 14 '10 at 20:09 2010-09-14 20:09
source share