tags:

views:

22

answers:

1

Hello,

are all "Standard Compliant (HTTP RFC?)" Web-Servers forced to "somehow" provide some methods to get all Parameters with the same name as some kind of list/array? Or will will using the same parameter name lead to overwriting:

Example:

http://www.stackoverflow?myparam=value1&myparam=value2

Will this lead to myparam holding the values "value1,value2" or only "value2" (due to overwriting and only using the last one). Is this behaviour mandated by some standard?

thanks bernhard

+2  A: 

Web servers do not consider the query at all; they just use the path to find the corresponding file below the document root. The rest is up to the handler if that targeted file is intended to be handled by a specific handler (like files ending with .php, .asp, .shtml, etc.). The specification of application/x-www-form-urlencoded does not say anything about that neither.

So it’s not specified how to handle repeated names and thus probably up to the language/program that interprets such a query.

Gumbo
thanks, thats interesting to hear that this is not specified somewhere.
bernhard
@bernhard: You could conclude that as *multipart/form-data* specifies that names are unique in a form (see http://tools.ietf.org/html/rfc2388#section-3), this does also apply to *application/x-www-form-urlencoded*. But when you think of checkbox controls, they must have the same name to be considered as a group. So in the end it depends on the interpreter that interprets the form data how to handle such cases.
Gumbo