I have a form that's been submitted with a large amount of checkboxes on. I want to find out if they are ticked. But they have a dynamic name such as subtopic1, subtopic5, subtopic24 etc.
So how can I find out which have been ticked?
Loop through all the checkbox names $POSt['checkbox1'], $POST['checkbox2'], etc. (look up variable variables in the manual). If they're set, the checkbox was ticked.
The names were dynamic so that wouldn't have worked but never mind I found a way now.
Help this resource grow by posting your solution!🆒
do a simple if isset...
if (isset($_post['check_box1'])) { print "Check Box was clicked"; } else { print "Check box not clicked" }
html looks like... <INPUT TYPE="CHECKBOX" NAME="check_box1">
this will check if the check box is clicked.