<?php
if (access(1)) {
$comm_r = mysql_query("SELECT `id_".$type."` FROM `".$type."_comm` WHERE `id` = '$id'");
$comm = mysql_fetch_assoc($comm_r);
if ($comm['id_'.$type]) {
mysql_query("DELETE FROM `".$type."_comm` WHERE `id` = '$id'");
redirect('?act=comm&id='.$comm['id_'.$type]);
} else {
redirect('?');
}
} else {
redirect('?');
}
?>