It is OK to have form inputs with the same name:
<form>
<input type="text" name="email">
<input type="text" name="email">
</form>
A GET action on the form produces the following query string: ...?email=&email=
Because emails exist for their own, thats fine.
Now, if there is data that belongs together (like to the same person):
<form>
<input type="text" name="first_name">
<input type="text" name="last_name">
<input type="text" name="first_name">
<input type="text" name="last_name">
</form>
The following query string is generated: ...?first_name=&last_name=&first_name=&last_name=
I guess that the parameter ordering in the query string is the same as the elements appear within the html... nevertheless, I am not sure if this is always the case.
Because the query string is essentially a key/value map, ordering should not matter...
I could add an index to each name but that would require to known the last index everytime I would add a new pair on the client.
Ideally I would like to avoid having to add an index by myself to keep the structure more dynamic.
Are there some better strategies to avoid relying on the order of the query string parameters? Array notation on the name seems to be one way that is used for PHP but I would like to have a more generic way (not using PHP on the server)...