2009-07-09 8 views

Répondre

1

Voir:

Enumerate all Check Box in PHP

<input name="rows[]" value="someVal" type="checkbox" /> 
<input name="rows[]" value="anotherVal" type="checkbox" /> 

<?php 
    // $_POST['rows'] contains the values of all checked checkboxes 

    //if something has been checked 
    if(isset($_POST['rows'])) { 

     //loop over each checked value 
     foreach ($_POST['rows'] as $row) { 
      echo $row . '<br />'; 
     } 
    } 
?> 
+0

Ne pas oublier de tester isset ($ _ POST [ 'lignes']) dans le cas où aucune sont vérifiées – Greg

0
if (isset($_POST['mycheckbox'])) 
{ 
    draw_selectionCheckboxChecked(); 
} 
else 
{ 
    draw_NoCheckbox(); 
} 
Questions connexes