if checkbox is checked
Posted: Wed Sep 12, 2007 7:13 pm
Code: Select all
$query = "SELECT * FROM newsart GROUP BY count ORDER BY count desc";
$result = mysql_query($query) or die(mysql_error());
$green = "#CCFF99";
$blue = "#99FFFF";
$color = array($green, $blue);
$g = "0";
echo "<form method=\"post\" id=\"action\" name =\"form\" action=\"{$_SERVER['PHP_SELF']}\"><td>
<table width=\"100%\">";
while($row = mysql_fetch_array($result))
{
echo "<tr bgcolor=\"$color[$g]\">
<td>". $row['news_title'] ."</td>
<td>". $row['name'] ."</td>
<td>". $row['time'] ."</td>
<td><input name=\"\" type=\"checkbox\" name=\"checked[". $row['count'] ."]\" value=\"". $row['count'] ."\"></td></tr>";
$g++;
if($g == "2")
{
$g = "0";
}
if($checked[$row['count']] == $row['count'])
{
echo "FINALLY!";
}
}
echo "<td><input type=\"submit\" value=\"Delete Selected\" /> </td></table></td></tr></table></form>";