I'm developing a little php script and am having problems with checkboxes. I'm doing all processing in one php file, and need to reprint the form with checkboxes checked if there are errors. I'm able to correctly pull which of the checkboxes were selected upon submission, but somehow when I print "checked=" (either true or false), they ALL get checked. The resulting HTML shows correctly, and I tested the HTML theory without the PHP so I'm thinking this is the correct way to do it, but it's not working and starting to tick me off...
ETA: So, it does work when I change it to print checked="checked" if true and nothing otherwise, but I'm still confused as to why my pure HTML (with checked true/false) worked and yet this code acts up. Maybe it was a problem on my HTML testing, but really, it worked...
This one here clearly isn't the most sophisticated php script (although its actual intention will have a real use), but I would like to know (a) what I'm doing wrong in this instance, and (b) how the rest of you usually handle forms and checkboxes.