怎么根据复选框的值选择相应的数据。

解决方案 »

  1.   

    复选框的名字命名为数组的形式,其值为记录的值,提交后,统计复选框,并列出值
      

  2.   

    <?php
     echo "<pre>";
     if ($_POST) print_r($_POST['select']);
     echo "</pre>";
    ?><form method=post action="">
    <? for ($i = 0; $i < 10; $i++) {
    echo "<input type='checkbox' name='select[]' value='select$i'>select$i<br/>";
    }
    ?>
    <input type="submit">
    </form>