2009-07-09 53 views

回答

1

参见:

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

不要忘记测试isset($ _ POST [ '行'])的情况下,没有进行检查 – Greg 2009-07-09 08:47:35

0
if (isset($_POST['mycheckbox'])) 
{ 
    draw_selectionCheckboxChecked(); 
} 
else 
{ 
    draw_NoCheckbox(); 
} 
相关问题