I am processing an html form using php. My question is specifically about input type checkbox:
<input type="checkbox" name="checkme" value="checked" <***php echo $data['checkme']; ***> >
This works for me because, on load, $data['checkme'] = ""; and on error, $data['checkme'] = "checked". I have searched quite a bit regarding this, and there are plenty of suggestions for setting the value of the checkbox input. But not in this way (that I found). This works, but I want to make sure I am not creating a problem that I don't foresee.
My question: Is this good practice?
checkedHTML5? I thought previous format waschecked="checked". Anyway, back to the real question, I usually have it asif(!empty().. { echo 'checked="checked"';}$dataorcheckmedon't exist you'll throw a notice.