Просмотр поста

.
ДоХтор

Udesign,

обработка ошибок (+/-)
$error = [];
$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 {
    echo $text;
}