Great way to check what values to collect before writing any code.
1 2 3 4 5 6 7 8 9 10 |
<form action="checkboxespostcollect.php" method="post"> <input type="checkbox" name="check_list[]" value="value 1"> <input type="checkbox" name="check_list[]" value="value 2"> <input type="checkbox" name="check_list[]" value="value 3"> <input type="checkbox" name="check_list[]" value="value 4"> <input type="checkbox" name="check_list[]" value="value 5"> <input type="submit" /> </form> |
checkboxespostcollect.php
1 2 3 4 5 6 7 8 9 |
<?php if(!empty($_POST['check_list'])) { foreach($_POST['check_list'] as $check) { echo $check; } } ?> |