note 57528 deleted from faq.html by mazzanet
| From: | mazzanet@php.net | Date: | Wed, 23 Nov 2005 09:06:16 +0000 |
| Subject: | note 57528 deleted from faq.html by mazzanet | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-98960@lists.php.net to get a copy of this message | ||
Note Submitter: drane
----
This is a follow-up to
Kenn White kennwhite dot nospam at hotmail dot com
's discussion on standards compliance when arrays are submitted from HTML forms.
(name="myarray[1]")
Reading the HTML 4 spec,
http://www.w3.org/TR/1999/REC-html401-19991224/types.html#type-cdata
--quote:
ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters,
digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and
periods (".").
--end quote
It would seem that you're not allowed to use [ or ] characters in 'id' OR
'name' properties.
I read the the relevant parts and found nothing that made any special exceptions for form element
names.
In summary, PHP's way of allowing arrays to be submitted from a form appears to be
standards-incompliant with HTML 4, probably XHTML 1, and likely any future standards. I really hope
they come up with some other way to do it. I'm thinking semicolons or underscores...
Doing something like name="myarray;1;" isn't the end of the world, and it's just
weird enough that it probably won't break any existing forms.
-drane