note 502 deleted from language.variables.external by philip
| From: | philip@php.net | Date: | Mon, 08 Jul 2002 17:37:25 +0000 |
| Subject: | note 502 deleted from language.variables.external by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-32741@lists.php.net to get a copy of this message | ||
The "checkbox" input type, by definition, is designed to return multiple values, so when
writing a form with checkboxes that will get submitted to a PHP script, you need to use the
varname[] syntax in the form. An example:
<form method="post" action="foo.php3">
<input type="checkbox" name="signup[]"
value="dance class">
<input type="checkbox" name="signup[]"
value="yoga class">
...
If you don't use the [], then the variable $signup will contain the last of the (multiple...)
checked boxes when the form is submitted.