<?php
$data = $_POST;
if ( isset($data['add']) ) {
$errors = array();
if ( htmlspecialchars($data['head']) ) {
$errors[] = 'Ошибка';
}
if ( empty($errors) ) {
$posts = R::dispense('posts');
$posts->head = $data['head'];
$posts->desc = $data['desc'];
R::store($posts);
echo $result;
}else
{
echo $errors;
}
}
?>
if ( preg_match('/[<>]/', $data['head']) ) {
$errors[] = 'Ошибка';
}