> >>use [] in your select box name. When it comes back in the
> >>$_POST array you
> >>will have an array of options.  It breaks HTML standard
> >
> >
> > No, it does not break HTML standards -- that is a PHP urban myth
(which,
> to
> > my chagrin, I helped to propagate before a wiser head sent me to
read
> said
> > standards in minute detail).  It does not even break XHTML
standards.
> >
> > Believe me -- I've interrogated the damn standards to within an inch
of
> > their lives, and they nonetheless insist that [] are legal
characters in
> > form element name= attributes, and form element name= attributes are
> *not*
> > deprecated.
> >
> 
> while I agree that it doesn't break standards - I do find it odd.
> 
> and annoying in that it limits the ability of php to  process certain
> forms ...
> 
> I don't see any benefit of this system - it would be better if php
just
> created an array for suitable form data - without requiring that the
> element name changes.

How does php know what "suitable form data" is?

I guess it could look for multiple names in the GET or POST data. But
then that would mean for every variable it goes to create, it would have
to go and look if it's already created one by that name. If it did,
erase the old one and make these two an array now. 

Rather than doing that, it can just look for [] in the name and it knows
to make that an array.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to