You are here: Re: POST checkbox group « All PHP « IT news, forums, messages
Re: POST checkbox group

Posted by Michael Fesser on 01/31/07 13:29

..oO(Richard Walker)

>Trying to send the data from a checkbox group to a php process and it's
>just sending the last box clicked as a variable, rather than the whole
>group as an array. Am I being stupid?
>
>ie html:
>
> <form name="selectform" action="data.php" method="post">
> <input name="days" type="checkbox" value="mon" />Mon
> <input name="days" type="checkbox" value="tue" />Tue
> <input name="days" type="checkbox" value="wed" />Wed
> <input type="submit" name="Submit" value="Submit" />
> </form>

Use name="days[]". Then $_POST['days'] will be an array, containing the
values of all checked checkboxes.

Micha

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация