For that matter, you don't even need the keys.... <? if($_POST['foo']) { for($i=0;$i<count($_POST['foo']);$i++) { echo $i.": ".$_POST['foo'][$i]."<BR />\n"; } exit; } ?> <FORM METHOD="POST" ACTION="<?=$PHP_SELF;?>"> <INPUT TYPE="CHECKBOX" NAME="foo[]" VALUE="Checked_one">One <INPUT TYPE="CHECKBOX" NAME="foo[]" VALUE="Checked_two">Two <INPUT TYPE="CHECKBOX" NAME="foo[]" VALUE="Checked_three">Three <INPUT TYPE="CHECKBOX" NAME="foo[]" VALUE="Checked_four">Four <INPUT TYPE="CHECKBOX" NAME="foo[]" VALUE="Checked_five">Five <INPUT TYPE="CHECKBOX" NAME="foo[]" VALUE="Checked_six">Six <INPUT TYPE="CHECKBOX" NAME="foo[]" VALUE="Checked_seven">Seven <INPUT TYPE="CHECKBOX" NAME="foo[]" VALUE="Checked_eight">Eight <INPUT TYPE="CHECKBOX" NAME="foo[]" VALUE="Checked_nine">Nine <INPUT TYPE="CHECKBOX" NAME="foo[]" VALUE="Checked_ten">Ten On 4/27/07, Richard Lynch <ceo@xxxxxxxxx> wrote:
On Fri, April 27, 2007 3:02 am, Maxim.Sedelnikov@xxxxxxxxxxx wrote: > Need to POST multiple values with single name. > > Ex. > -----------------------------55751342416306771991025074398 > Content-Disposition: form-data; name="licenses" > > lic1 > -----------------------------55751342416306771991025074398 > Content-Disposition: form-data; name="licenses" > > lic2 > > > Function http_post_fields() cannot be used due to an _associative_ > array > of POST values. PHP will cheefully accept POST data with arrays with keys. <input name="foo[42]" value="forty-two" /> <input name="foo[15]" value="fifteen" /> <input name="foo[banana]" value="yes, please" /> var_dump($_POST['foo']); -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
-- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107