Размер файла: 1.51Kb
<?php
error_reporting(0);
session_name('PHP');
session_start();
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';
$mode=@mysql_query("SELECT * FROM `".prefix."moderka` WHERE `mod`='".$_USER['login']."'");
If(!$mode){echo 'err';}
if (mysql_num_rows($mode)!=0){
$moder = $_USER['login'];
}
If ($_USER['admin'] || $moder){
$id = intval($_GET['id']);
$empty = intval($_POST['empty']);
$sql = mysql_query("SELECT * FROM `".prefix."chat` WHERE `id` = '$id'");
if (mysql_num_rows($sql) < '1') {
header("Location: /besedka/");
}
if (empty($empty)) {
echo '<div class="downsw"><b>Удалить сообщение</b></div>
<form action="del.php?id='.$id.'" method="POST">
<input type="hidden" name="empty" value="1" />
<input type="submit" class="form" value="Да" /> <a href="/besedka/"><input type="button" class="form" value="Нет" /></a>
</form>
'; include "../header/end.inc.php";
break;
} else {
$sql_delete = @mysql_query("DELETE FROM `".prefix."chat` WHERE `id` = '$id'");
if ($sql_delete) {
header("Location: /besedka/");
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;
}
?>