Check Boxes PHP
Posted: Thu May 01, 2003 12:00 pm
Well i ahve 12 check boxes
I want it so when user clicks one it goes to the database
but when user clicks no check boxes i want an error to appear
i started this code can anyone please provide me with an example
i ahve been trying to fiqure this out forever
Code:
$checkboxes = array("C49", "C49");
foreach ($checkboxes as $box) {
if (isset($_POST[$box])) {
$found = false;
break;
}
echo 'You have not entered all the required details.<br />'
.'Please go back and try again.';
exit;
}
I want it so when user clicks one it goes to the database
but when user clicks no check boxes i want an error to appear
i started this code can anyone please provide me with an example
i ahve been trying to fiqure this out forever
Code:
$checkboxes = array("C49", "C49");
foreach ($checkboxes as $box) {
if (isset($_POST[$box])) {
$found = false;
break;
}
echo 'You have not entered all the required details.<br />'
.'Please go back and try again.';
exit;
}