Файл: wenr.online/app/mod/faq.php
Строк: 15
<?php
if($user->get()->role < 1){
redirect('/game');
exit;
}
if(isset($_POST['name'])){
$name = Clean :: str($_POST['name']);
$text = Clean :: text($_POST['text']);
if(empty($name)){
Notif :: error('Введите название статьи','/mod/faq');
exit;
}
if(empty($text)){
Notif :: error('Введите текст статьи','/mod/faq');
exit;
}
$sql = $db->prepare('insert into `faq` (`name`,`text`) values (?,?)');
$sql -> execute([$name,$text]);
notifSend(5,$user->get()->nick.' добавил новую статью в помощь по игре');
Notif :: message('Вы успешно добавили статью в помощь по игре','/mod/faq');
exit;
}
echo $template->render('mod.faq');