<?php
$data = $_POST;
if ( isset($data['add']) )
{
$posts = R::dispense('posts');
$posts->post_head = $data['post_head'];
$posts->post_desc = $data['post_desc'];
R::store($posts);
header("Location: /");
}
?>
<form action="/" method="POST" onload="form.reset()">
<input type="text" name="post_head" required />
<input type="text" name="post_desc" required />
<button type="submit" name="add">Добавить</button>
</form>