Bob Lockie wrote:
I tried this HTML:
<input name="deleteID" value="1" type="checkbox">
<input name="deleteID" value="2" type="checkbox">

$_REQUEST['deleteID'] === the last box checked.
so I did a google search and changed my HTML to:

<input name="deleteID[]" value="1" type="checkbox">
<input name="deleteID[]" value="2" type="checkbox">

Now the code:
for ($i = 0; $i < count($_REQUEST['deleteID']); $i++){
    echo "deleting '" . $value . "'";
}
has the right count but how do I get the values out?

$_POST['deleteID'][0] will be the first checked checkbox value, $_POST['deleteID'][1] will be the second, etc. count($_POST['deleteID']) will tell you how many were checked, implode(',',$_POST['deleteID']) will give you a comma separated list, etc, etc...


--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to