I have this form
<form action=\"login.php?action=del&password=<?echo $pass?>\" method=post>
<table border=1 width=550 cellpadding=0 cellspacing=0 align=center>
<tr align=center>
<td>ID</td><td width=70>Year & Set</td><td width=100>Subject</td><td width=40>Staff</td><td width=250>Homework set</td><td width=90>Date Due in</td><td>Tick To Delete</tr>
<?
$result = mysql_query( \"SELECT * FROM hwkset\" );
$num_rows = mysql_num_rows( $result );
print \"There are currently $num_rows homework(s) set in the table<p>\";
while ( $a_row = mysql_fetch_array( $result ) ) {
?>
<tr align=center>
<td><?echo $a_row[id]?></td><td width=70><?echo $a_row[year]?></td><td width=100><?echo $a_row[subject]?></td><td width=40><?echo $a_row[Staff]?></td><td width=250><?echo $a_row[hwkset]?></td><td width=90><?echo $a_row[date]?><td><input type=\"checkbox\" name=\"tick[]\" value=\"<? $a_row[id]?>\"></td>
</tr>
<?
}
mysql_close( $link );
?>
</table>
<input type=submit value=\"Delete Homework\">
Which goes on to
elseif($action == \"del\" && $password == $pass) {
global $tick;
if ( ! $link ) die ( \"Couldn\'t connect to MySQL server\" );
mysql_select_db( $db, $link ) or die ( \"Couldn\'t open
$db: \".mysql_error() );
if(count($tick)>0) {
foreach($tick as $id) {
if(mysql_query(\"DELETE FROM hwkset WHERE id=\'$id\'\")) {
echo \"Homework $a_row[id] deleted successfully<br>\";
} else {
print \"mysql-Error:\".mysql_error().\"<br>\";
}}}
exit;
}
but the variable for $tick is not passing through. The form says its deleted the homework if the box is ticked but it doesnt actually delete it, can anyone tell me how to fix it