Reply to Re: How do get the state of checkboxes in php?

Your name:

Reply:


Posted by macca on 09/08/07 00:38

The HTML form:

<p>Please select every sport that you play.</p>

Soccer: <input type="checkbox" name="sports[]" value="soccer" /><br /
>
Football: <input type="checkbox" name="sports[]" value="football" /
><br />
Baseball: <input type="checkbox" name="sports[]" value="baseball" /
><br />
Basketball: <input type="checkbox" name="sports[]"
value="basketball" />





---------------------------------------------------------------------------------------

The php script:


$sports = $_POST['sports']; // is an array holding all the checked
boxes

foreach ($sports as $checked_sport){

echo $checked_sport."<br />"; // Output the checked boxes to the
output device.

}

[Back to original 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

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