• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

[PHP] Checkbox Array questions

ckevin

New Member
I want to know how can I get the checkbox array work as:

<input type=checkbox value=A name="test[GREAT]">A<br>
<input type=checkbox value=B name="test[GOOD]">B<br>
<input type=checkbox value=C name="test[BAD]">C<br>

For example, if value A and B is selected, in the php, it can parse out as:

PHP:
$totaltests = count($_POST['test']);

echo "<a href=work.php?total=$totaltests&GREAT=A&GOOD=B>click</a>";

Thanks!
 
PHP:
<?
$totaltests = count($_POST['test']);
echo "<a href=work.php?total=$totaltests";
foreach( $test as $id => $value) {
echo "&" . $id . "=" . $value;
}
echo ">click</a>";
?>
 
Back
Top