dimanche 22 février 2015

POST unchecked checkboxes with hidden elements

I know there are other posts with the same question but it doesn't work for me. Well, I have a database table (image) with 'img_name' and 'img_status'. Status can be 'active' or 'inactive'. In php I do following: $images = mysqli_query($con, "SELECT * FROM images");



while($row = mysqli_fetch_object($images)) {
if ($row->img_status == 'active') {
echo '<label><input type="checkbox" name="image[]" value="' . $row->img_name . '" checked> ' . $row->img_name . '</label>';
} else {
echo '<label><input type="checkbox" name="image[]" value="' . $row->img_name . '"> ' . $row->img_name . '</label>';
}
}




Aucun commentaire:

Enregistrer un commentaire