RE: [PHP] Correct handling _POST[] and implode. PHP5

From: Date: Fri, 09 Oct 2009 09:07:55 +0000
Subject: RE: [PHP] Correct handling _POST[] and implode. PHP5
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-298797@lists.php.net to get a copy of this message
I just realised I have get_magic_quotes_gpc turned on and was not catering for arrays. Thanks for your time. Adam Andrea Giammarchi-3 wrote: > > > >> 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¶e£î}_ñ7 > œ©Ç'Ü2í > -- View this message in context: http://www.nabble.com/Correct-handling-_POST---and-implode.-PHP5-tp25815789p25817889.html Sent from the PHP - General mailing list archive at Nabble.com.

« previous php.general (#298797) next »