add restrictions to writing posts

writing a new post now redirects back to the form if you try to write a post
without a title or without content. error messages have also been added.