HTML表格:
<table width="100%" cellpadding="0" cellspacing="0" border="0" id="table" class="tablesorter">
<thead>
<tr>
<th><h3>ID</h3></th>
</tr>
</thead>
<tfoot>
<tr>
<th><h3>ID</h3></th>
</tr>
</tfoot>
<tbody>
<?php getClicksReport(); ?>
</tbody>
功能PHP:
function getClicksReport() {
$query = mysql_query("SELECT * FROM clicks ORDER BY id DESC") or die(mysql_error());
while($click = mysql_fetch_assoc($query)) {
echo '<tr>';
echo '<td>' . $click['id'] . '<span class="idcheckbox"><input name="id[]" type="checkbox" value="'.$click['id'].'"/></td>';
}
}
和.....
if(isset($_POST['akceptlead']) && $_POST['id']){
$total = count($_POST['id']);
for($i=0; $i<$total; $i++) {
$akceptujLeada = mysql_query("DELETE FROM leads WHERE id ='".$_POST['id'][$i]."'") or die(mysql_error());
}
header("Location: clicksReport.php");
}
我在html表中选择记录,单击“接受所选”按钮,但是什么也没发生。
有人可以帮助我吗?