foreach($results as $rs){
     $id=$rs->id;
             $title=$rs->title;
             $fulltext=$rs->fulltext;
            
        
    <input type="checkbox" name="agree" id="agree"  border="0" />
    <img src="images/delete.png" alt="<?php echo $id;?>"   id="<?php echo $id;?>" onclick="alarm('<?php echo $fulltext;?>',<?php echo $id;?>)"/>循环输出删除键,为什么只有第一个能响应,其他的删除键没有响应;上面是主要代码;

解决方案 »

  1.   

    <input type="checkbox" name="agree" id="agree"  border="0" /> 
    这个需要这个改
    <input type="checkbox[]" name="agree" id="agree"  border="0" /> 
    这样复选框才能以数组的形式传值。
      

  2.   

    补充一下,表单的method只能为post,否则也是不可以的。
    <input type="checkbox[]" name="agree" id="agree"  border="0" /> 
    <?php
       $agree_arr=$_POST['agree'];
       foreach($agree_arr as $t){
           程序块……
       }
    ?>