mercredi 11 mai 2016

Checkboxes isset/empty within PHP [duplicate]

This question is an exact duplicate of:

If I have the following HTML and one checkbox is selected and in my PHP I have a variable set for both checkboxes what is a good way to check if one is not set use the other? isset and empty if statement?

HTML:

<div class="col-md-6 pull-right">
    <div class="form-group">
        <label class="col-sm-2">Gender</label> <label class=
        "col-sm-2 checkbox-inline"><input name="male" type="checkbox"
        value="0">Male</label> <label class=
        "col-sm-2 checkbox-inline"><input name="female" type=
        "checkbox" value="1">Female</label> 
    </div>

Aucun commentaire:

Enregistrer un commentaire