Fixing create post page

Placed an if/else statement that should handle post creation/failure in
the post succeeded method. Also included code that refreshes the page on
a successful post but does not refresh page if post is unsuccessful.
This is so that the user does not have to type out their entire post
again if something goes wrong.