# ДоХтор (07.09.2016 / 14:13)Вот так да
Udesign, $error = [];
$text = isset($_POST['text']) ? functions::checkin($_POST['text']) : '';
if (empty($text)) {
$error[] = 'Введите текст сообщения!';
} elseif (mb_strlen($text) < 10) {
Вот так (+/-)
<?php
define('_IN_JOHNCMS', 1);
include "incfiles/core.php";
$last_id =$id;
$text = isset($_POST['text']) ? functions::checkin($_POST['text']) : '';
if (empty($text)) {
$error[] = 'Введите текст сообщения!';
} elseif (mb_strlen($text) < 10) {
$error[] = 'Слишком короткий текст!';
}
if (!empty($error)) {
$ref = functions::checkin($_SERVER['HTTP_REFERER']) ;
echo functions::display_error($error, '<a href="'. $ref .'">Назад</a>');
} else {
mysql_query("INSERT INTO `cms_news_comments` SET
`refid` = '$last_id',
`time` = '" . time() . "',
`user_id` = '" . $user_id . "',
`text` = '" . mysql_real_escape_string($text) . "';");
$_SESSION['error'] = '<div class="gmenu">' . $lng_news['added_message'] . '</div>';
}все равно не отправляет в базу вы проста попробуйте на своим деншере