note 57528 added to faq.html
| From: | drane at osu1 dot php dot net | Date: | Thu, 06 Oct 2005 14:35:03 +0000 |
| Subject: | note 57528 added to faq.html | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-96511@lists.php.net to get a copy of this message | ||
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
----
Manual Page -- http://www.php.net/manual/en/faq.html.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+57528
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+57528&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+57528&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+57528&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+57528&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+57528&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+57528&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+57528&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+57528&report=yes
Search -- http://master.php.net/manage/user-notes.php