View file fnc/news/news_add.php
<?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(($msg!="") and ($name!="") or ($msg!="") and ($log!="")) { $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(); } } ?>