News新闻

业界新闻动态、技术前沿
Who are we?

您的位置:首页      乐道系统FAQ      php批量删除操作(数据访问)

php批量删除操作(数据访问)

发布日期:2017-05-23 00:00:00 55
【CLI】利用Curl下载文件实时进度条显示的实现

本文实例为大家分享了php批量删除操作的具体代码,供大家参考,具体内容如下

1.批量删除页面 piliangcaozuo.php

<body>
<form action="shanchu.php" method="post">
<table width="100%" border="1" cellpadding="0" cellspacing="0">
  <tr>
    <td><input type="checkbox" name="qx" onclick="quanxuan(this)"/>代号</td>
    <td>名称</td>   
  </tr>
  <?php
   require"DBDA.class1.php";
   $db = new DBDA();
   $sql = "select * from nation";
   $arr = $db->query($sql);
   foreach($arr as $v)
  {
    echo "<tr>
        <td><input type='checkbox' name='ck[]' class='ck' value='{$v[0]}'/>{$v[0]}</td>
        <td>{$v[1]}</td>   
       </tr>";
  }
  ?>  
</table>
<input type="submit" value="批量删除" />
</form>
</body>
<script type="text/javascript">
function quanxuan(qx)
{
  var ck=document.getElementsByClassName("ck");
  if(qx.checked)
  {
    for(var i=0;i<ck.length;i++)
    {
      ck[i].setAttribute("checked","checked");
    }
  }
  else
  {
    for(var i=0;i<ck.length;i++)
    {
      ck[i].removeAttribute("checked");
    }
  }
}
</script>
</html>