Hopefully someone can help me with this. I’m trying to write a script with a dynamic amount of things to be processed.
First the page will be submitting checkboxes, some checked, some not. The amount of checkboxes submitted will be dynamic because it’s dependent upon the amount of entries on the list. The script needs to be able to interpret every checkbox to see if it is check. If the checkbox is checked, the script needs to write the value of the selected value of the checkbox to a file.
I’ve never done anything which has a variable number of $_POST variables. Some assistance would be greatly appreciated.
If I understood your question correctly,
Supply an array as the
nameof the checkboxesThen
$array = $_POST['abc']will return an array with values of only those checkboxes that were checked.