Может так:
if (!empty($с))//есть ли шота в масиве
$t=count($c);
{
do
{
$result = mysql_query("SELECT * FROM `forms` WHERE `id` in (" .join(',',$c).")",$db);
$myrow = mysql_fetch_array($result);
unlink("../admin/forms/".$myrow[file]);
$t=$t-1;
}
while ($t>1)
};
<form name="form" method="post" action="имя скрипта удаляющего инфу">
<?
include("../register/dbconnect.php");
$x=1;
$result = mysql_query("SELECT * FROM `forms` ORDER BY `id` DESC",$db);
if ($myrow = mysql_fetch_array($result))
{
$n=0;
do
{
$count++;
print ("<tr");
if ($count/2==intval($count/2))
print (" bgcolor=#f2f6f9");
printf ("><td><input type=checkbox name=c[] value=%s> $x</td><td> <a href=\"../admin/forms/%s\">%s</a></td><td> %s</td></tr>\n", $myrow['id'], $myrow['file'], $myrow['subj'], $myrow['date']);
$n++;
$x++;
}
while ($myrow = mysql_fetch_array($result));
};
?>
</table>
<br><input type="submit" name="Submit" value="delete">
</form>
Файл который все удаляет:
PHP:
include("dbconnect.php");
$result = mysql_query("SELECT * FROM `forms` WHERE `id` in (" .join(',',$c).")",$db);
if ($myrow = mysql_fetch_array($result))
{
do
{
unlink("../admin/forms/".$myrow['file']);
}
while ($myrow = mysql_fetch_array($result));
};
$result = mysql_query("DELETE FROM `forms` WHERE `id` in (" .join(',',$c).")",$db);
include("forms.php");