Hi there everyone!
I've got a loop that builds checkboxes for any images relating to a submission, so the checkboxes end up looking like this:
<input type="checkbox" name="image-PXA5034-78573-1.jpg" checked> Include Image<br>
<input type="checkbox" name="image-PXA5037-48927-2.jpg" checked> Include Image<br>
<input type="checkbox" name="image-PXA5027-23343-7.jpg" checked> Include Image<br>
And I need to check for ISSET on the processing end. The problem I'm having is that I can't figure out how to dynamically alter the $_POST element it's checking.
During the processing, I have the value of $pic and $pic is everything in the name of the checkbox except for 'image-'. So I need to figure out the following:
if $pic = PXA5034-78573-1.jpg
Then I need to have the following check:
if(ISSET($_POST['image-PXA5034-78573-1.jpg']))
but I've tried a lot of stuff and none of it's working. This was my last attempt:
if(ISSET($_POST['image-'.$pic])){
which didn't throw an error but also didn't operate as desired. Everything ran as if !ISSET.
Could someone set me straight on how I would handle this?
Thanks for your time!