note 37587 added to function.sizeof

From: Date: Thu, 20 Nov 2003 10:42:13 +0000
Subject: note 37587 added to function.sizeof
Groups: php.notes 
Request: Send a blank email to php-notes+get-60676@lists.php.net to get a copy of this message
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 ---- Manual Page -- http://www.php.net/manual/en/function.sizeof.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+37587 Delete -- http://master.php.net/manage/user-notes.php?action=delete+37587&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+37587&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#60676) next »