I need help using checkboxes to delete mutliple entrys, everything connects right and such, just it keeps saying the array is empty
<FORM ACTION="deletepost.php"><?php
include('db.php');
$q = mysql_query("SELECT * FROM $table ORDER BY id DESC LIMIT $limit");
while($r=mysql_fetch_array($q)){
$news = $r["message"];
$id = $r["id"];
$author = $r["author"];
echo "<FORM ACTION=\"deletepost.php\">
<table border=\"1\" align=\"center\" width=\"760\">
<tr align=\"center\"><td>
<INPUT TYPE=CHECKBOX NAME='delete[]' value ='$id' method= 'post'>Delete a Post!
<P>
<td width = \"500\">$author<br>$news</td></tr></table>
";
}
?>
<p align = "center">
<INPUT TYPE=SUBMIT VALUE="Submit">
</FORM>
deletepost.php:
<?php
include ('db.php');
$post =$_POST['delete'];
echo $post;
foreach($post as $iddelete) {
mysql_query("DELETE FROM news WHERE id='$iddelete'");
}
die("<pre>".print_r($_POST,True));
?>
?>
Warning: Invalid argument supplied for foreach() in /home/cheney/public_html/deletepost.php on line 9
Array
(
)
Thats the error I get