<?
require_once '../../../core/system.php';
echo only_reg();
echo moder();
if (isset($_GET['id']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_topic` WHERE `id` = '".intval($_GET['id'])."'"),0) == true){
$topic = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_topic` WHERE `id`  = '".intval($_GET['id'])."'"));
}else{
$_SESSION['err'] = "Топик не найден!";
header('Location: /forum/');
exit();
}
header("Location: /forum/post/$topic[id_razdel]/");
mysql_query("DELETE FROM `forum_topic` WHERE `id` = '$topic[id]'");
$_SESSION['message'] = "Топик удален!";
exit();
?>