Файл: adm_panel/spam.php
Строк: 88
<?
include_once '../sys/inc/start.php';
include_once '../sys/inc/compress.php';
include_once '../sys/inc/sess.php';
include_once '../sys/inc/home.php';
include_once '../sys/inc/settings.php';
include_once '../sys/inc/db_connect.php';
include_once '../sys/inc/ipua.php';
include_once '../sys/inc/fnc.php';
include_once '../sys/inc/adm_check.php';
include_once '../sys/inc/user.php';
user_access('adm_accesses',null,'index.php?'.SID);
adm_check();
$set['title']='Антиспам';
include_once '../sys/inc/thead.php';
title();
err();
aut();
################################################################################
if (isset($_POST['ok'])){
$text=htmlspecialchars(mysql_real_escape_string($_POST['text']));
$sait=htmlspecialchars(mysql_real_escape_string($_POST['sait']));
if(strlen2($text)<1)$err[]='Текст не менее 1 символа';
if(strlen2($sait)<1)$err[]='На что заменяем не менее 1 символа';
if(!isset($err)){
mysql_query("INSERT INTO `anti_spam` (`text`, `sait`) VALUES ('".htmlspecialchars(mysql_real_escape_string($_POST['text']))."', '".htmlspecialchars(mysql_real_escape_string($_POST['sait']))."')");
msg('Успешно');
}}
################################################################################
if (isset($_GET['id']) && isset($_GET['act']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `anti_spam` WHERE `id` = '".intval($_GET['id'])."'"),0))
{
if ($_GET['act']=='dels')
{
mysql_query("DELETE FROM `anti_spam` WHERE `id` = '".intval($_GET['id'])."' LIMIT 1");
msg('Сайт успешно удалён.');
}
}
################################################################################
echo "<form action="?" method="post">";
echo "Текст:<br />n";
echo "<input type='text' name='text' /><br />n";
echo "На что заменяем:<br />n";
echo "<input type='text' name='sait' /><br />n";
echo "<input name='ok' value="Добавить" type="submit" />n";
echo "</form>n";
################################################################################
echo "<table class='post'>n";
$wwe=mysql_query("SELECT * FROM `anti_spam`");
while ($www = mysql_fetch_assoc($wwe))
{
echo " <tr>n";
echo " <td class='p_t'>n";
echo "Сайт: <u>$www[text]</u>n";
echo " </td>n";
echo " </tr>n";
echo " <tr>n";
if ($set['set_show_icon']==1)echo " <td class='p_m' colspan='2'>n"; else echo " <td class='p_m'>n";
echo "Как теперь подписан: <u>$www[sait]</u><br />";
echo "<a href='?id=$www[id]&act=dels&$passgen'>Удалить</a>";
echo " </td>n";
echo " </tr>n";
}
echo "</table>n";
################################################################################
if (user_access('adm_panel_show')){
echo "<div class='foot'>n";
echo "«<a href='/adm_panel/'>В админку</a><br />n";
echo "</div>n";
}
include_once '../sys/inc/tfoot.php';
?>