note 37587 deleted from function.sizeof by didou
| From: | didou@php.net | Date: | Thu, 20 Nov 2003 10:50:57 +0000 |
| Subject: | note 37587 deleted from function.sizeof by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-60677@lists.php.net to get a copy of this message | ||
Note Submitter: erwin@dexus.nl
----
You might wonder, like me, why you cannot use checkboxes the 'normal' way like this:
<form action="somephp.php" method="POST">
<input type="checkbox" name="country" value="test1">
<input type="checkbox" name="country" value="test2">
<input type="checkbox" name="country" value="test3">
<input type="submit">
</form>
If more than 1 box is selected PHP will receive *only* one value for the
$_HTTP_POST_VARS["country"]
Why didn't the people who designed this peace of code put all the values comma-seperated in
country?? Then the receiving script can use implode to make an array out of it.
I think the array-approach isn't nice at all. :-(
This is how it should be done in PHP:
<form action="somephp.php" method="POST">
<input type="checkbox" name="country[0]" value="test1">
<input type="checkbox" name="country[1]" value="test2">
<input type="checkbox" name="country[2]" value="test3">
<input type="submit">
</form>
But besides that: great languange. :-)
Regards,
Erwin