RE: Correct handling _POST[] and implode. PHP5

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> so it's simple, it's not an array, but your assignment magically makes it an array since you wrote "iterate over the array" ... very, very clear, isn't it?

OK, sarcasm a part, this works perfectly for me, and it's quite obvious Colors IS an array ...

<?php
if(isset($_POST['Colors']))
    echo implode(',', $_POST['Colors'])
;
?>
<form method="POST" action="?">
    <input type="checkbox" name="Colors[]" value="green" checked="checked" /> Green
    <input type="checkbox" name="Colors[]" value="yellow" /> Yellow
    <input type="checkbox" name="Colors[]" value="red" /> Red
    <input type="checkbox" name="Colors[]" value="gray" /> Gray
    <input type="submit" />
</form>

Regards
 		 	   		  
_________________________________________________________________
Windows Live: Friends get your Flickr, Yelp, and Digg updates when they e-mail you.
http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_3:092010

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux