View file news/news.del.php

File size: 1.22Kb
<?php
include '../header/config.inc.php';
include '../header/function.inc.php';
include '../header/header.inc.php';
include '../header/connect.inc.php';
include '../header/click-club.class.php';
If (!isset($_GET['log'])) define("anybody","true");
include '../header/enter.inc.php';
include '../ban.php';

If ($_USER['admin']){

$id		=	intval($_GET['id']);
$empty	=	intval($_POST['empty']);
if ($id < '1') {
	header("Location: /news/");
}
if (empty($empty)) {

echo '
<div class="downsw">Удалить новость</div>
<form action="news.del.php?id='.$id.'" method="POST">
<input type="hidden" name="empty" value="1" />
<input type="submit" class="form" value="Да" /> <a href="/news/"><input type="button" class="form" value="Нет" /></a>
</form>

';

} else {

	$sql		=	@mysql_query("DELETE FROM `news_news` WHERE `id` = '$id'");
	$sql_comm	=	@mysql_query("DELETE FROM `news_comment` WHERE `news_id` = '$id'");

	if ($sql_comm && $sql) {
header("Location: /news/");
exit;

	} else {echo '	<div class="menuindex">
Произошла ошибка!
</div>';
       include "../header/end.inc.php";

break;

	}

}

} else {

	echo '<div class="menuindex">Как же достали эти хакеры!</div>';
    include "../header/end.inc.php";
    break;
}

 include "../header/end.inc.php";

?>