我有一个表从数据库中,像这样需要数据:(是不是一种形式)处理选中的复选框PHP
if (mysql_num_rows($result)) {
echo "<table id='logs' border='1' cellspacing='0' width='62%'>";
echo "<tr>";
echo "<th width='15%'>Time Registered</th>";
echo "<th width='15%'>Username</th>";
echo "<th width='15%'>Password</th>";
echo "<th width='15%'>IP Address</th>";
echo "<th width='2%'><a href=\"#\" onclick=\"checkAll(this);\">Mark</a></th>";
echo "<th width='2%'>Delete</th>";
echo "</tr>";
while ($row = mysql_fetch_row($result))
{
echo "<tr>";
echo ("<p><td>$row[2]</td><td>$row[0]</td><td>$row[1]</td><td><i>$row[3]</i></td><td><center><input type=\"checkbox\" name=\"mark[]\"/></center></td><td><a href=\"delete.php?time=$row[2]&user=$row[0]&pass=$row[1]&ip=$row[3]\"><center>[x]</center></a></td></p>");
echo "</tr>";
}
echo "</table>";
}
的部分<input type=\"checkbox\" name=\"mark[]\"/>
是复选框。我怎样才能找到并处理选中的复选框?
if(mark[$checked]) {
//delete data from database if row checked
}
所以我需要添加一个形式得到它的工作? – Kyle 2011-03-30 18:04:53