Файл: besedka/del.php
Строк: 69
<?php
session_name('im');
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';
include '../header/enter.inc.php';
include '../ban.php';
// Проверка IP
$login = $_USER['login'];
$enterip = $_USER['enterip'];
$ip = $_SERVER['REMOTE_ADDR'];
if ($ip !== $enterip) {
echo '<div class="downsw"><font color="#FF3300"><b>Провал!</b></font><br/>
<font color="#00FF00">Войдите в систему!</font><br/></div>';
session_destroy();
include '../header/end.inc.php';
exit;
}
$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;
}
?>