Posted by Ken Robinson on 03/24/06 20:35
> On Fri, 24 Mar 2006 08:34:51 -0800, fiziwig wrote:
> > I can do
> >
> > <INPUT TYPE="checkbox" NAME="cb123" VALUE="on">Category Description
> > <INPUT TYPE="checkbox" NAME="cb137" VALUE="on">Category Description
A different way to do this is
<INPUT TYPE="checkbox" NAME="cb[123]" VALUE="on">Category Description
<INPUT TYPE="checkbox" NAME="cb[137]" VALUE="on">Category Description
Then in you PHP, you can do
<?php
if (isset($_POST['cb']))
foreach $_POST['cb'] as $key=>$dmy)
echo 'You chose catagory ' . $key . '<br>';
?>
This works because only those checkboxes that are actually checked are
sent to your script.
Ken
[Back to original message]
|