Файл: profi_wm/modules/guest/add_mess.php
Строк: 10
<?php
include '../../system/core.php';
$us_id = trim(mysql_real_escape_string(htmlspecialchars($user['id'])));
$mess = trim(mysql_real_escape_string(htmlspecialchars($_POST['mess'])));
if($mess)
{
if(mysql_result(mysql_query("SELECT `content` FROM `guest` ORDER BY `id` DESC LIMIT 1"), 0) != $mess)
{
if((time() - $_SESSION['time_up']) > 5)
{
mysql_query("INSERT INTO `guest` SET
`user_id`='".(int)$us_id."',
`date`='".date('d.m.Y, H:i')."',
`time`='".time()."',
`content`='".$mess."'");
$_SESSION['time_up'] = time();
}
else
{
setcookie("errors", "<b>Не так быстро!<b>", time()+3, "/");
}
}
}
/* Тут удаление мессаг*/
if($_POST['del_mess'])
{
if($user['status'] >= 2) mysql_query ("DELETE FROM `guest` WHERE `id` = '".(int)$_POST['del_mess']."' LIMIT 1");
}
?>