Jörg Reinholz: Request Content-Type Header bei Upload

Beitrag lesen

Wenn das name-Attribut auf "[]" endet, dann werden die Werte auch erwartungsgemäß im $_POST-Array aufgeführt.

<select name="multi_selection[]" multiple="" size="3">

Bei der herkömmlichen Methode hat man dann allerdings ein zwei dimensionales Array.

Ich probiere mal was. Nämlich das direkte senden mit GET.

Ergebnis:

&multi_selection=sel+1&multi_selection=sel+2&multi_selection=no+value

Die Erfinder von formData haben also tatsächlich ein bekanntes Fehlverhalten nachgebaut. Hm. Eines, wo man in den Bezeichner zwei <http://de.selfhtml.org/html/referenz/attribute.htm#id_idref_name@title=seltsame Zeichen> einbauen muss, damit es funktioniert. (den Trick mit name='foo[]' kannte ich schon von einer "Gruppierung" von Checkboxen..

"Seltsam", weil aktuell für das name-Attribut gilt:

Any non-empty value for name is allowed, but the names "_charset_" and "isindex" are special:

isindex

This value, if used as the name of a Text control that is the first control in a form that is submitted using the application/x-www-form-urlencoded mechanism, causes the submission to only include the value of this control, with no name.
_charset_

This value, if used as the name of a Hidden control with no value attribute, is automatically given a value during submission consisting of the submission character encoding.

Jörg Reinholz