Lamez Posted August 21, 2008 Share Posted August 21, 2008 I use to have a long php script, but some how I lost it. I was wondering how could I process multiple check boxes? If checked: update mysql database if not checked: do nothing Link to comment https://forums.phpfreaks.com/topic/120664-solved-processing-multiple-check-boxes/ Share on other sites More sharing options...
MasterACE14 Posted August 21, 2008 Share Posted August 21, 2008 <?php foreach($_POST as $a => $b) { if ($a != "yes") { echo "not ticked"; } elseif ($a == "yes") { echo "ticked"; } } ?> Link to comment https://forums.phpfreaks.com/topic/120664-solved-processing-multiple-check-boxes/#findComment-621785 Share on other sites More sharing options...
Lamez Posted August 21, 2008 Author Share Posted August 21, 2008 so I do not get it, does that mean $a is checked? what is $b? is ticked, mean checked? -Thanks Once Again! Link to comment https://forums.phpfreaks.com/topic/120664-solved-processing-multiple-check-boxes/#findComment-621789 Share on other sites More sharing options...
The Little Guy Posted August 21, 2008 Share Posted August 21, 2008 Something similar to this: http://phpsnips.com/snippet.php?id=11 Link to comment https://forums.phpfreaks.com/topic/120664-solved-processing-multiple-check-boxes/#findComment-621792 Share on other sites More sharing options...
Lamez Posted August 21, 2008 Author Share Posted August 21, 2008 hey that seems a little easier to understand, thanks Link to comment https://forums.phpfreaks.com/topic/120664-solved-processing-multiple-check-boxes/#findComment-621794 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.