----- Original Message ----- 
From: "Frode" <[EMAIL PROTECTED]>
[...snip...]
Which means I can't modify the code above into PHP prefered
style:

<input type=checkbox name="box[]" value=1>
<input type=checkbox name="box[]" value=2>
....

[...snip...]

> Why is this the preferred style, and where can I read more about it?

I don't know about preferred style or not, but if you want PHP to recognize
multiple values from a form or URL, then you must add the [] onto the name
so PHP will put it into an array. Otherwise you end up with
"box=1&box=2&box=3" and when PHP parses that, each overwrites the other, so
you end up with $box == 3 at the end and the other values are lost. I'm sure
it's discussed in the Form Handling section of the manual.

---John Holmes...


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

Reply via email to