<?php
include"../../sys/fnc.php";
if($user[leval]==4)
{
$msg=filtr($_POST['msg']);
$name=filtr($_POST['name']);
$data=date("d.m.Y H:i");
if(!empty($msg) and !empty($name))
{
$res = $db->query("select * from `news` order by `id` desc limit 1");
$pole = $res->fetch_array();
if($pole[msg] != $msg)
{
$db->query("insert into `news`(`name`,`data`,`msg`) values('$name','$data','$msg')");
echo'<font color="red">Новость добавлена!</font>';
}
$res->close();
}
}
?>