I'm having a little problem in my own written MVC framework. When i post a form to another page i want to show a alert there.
For example: i have build a blog in my mvc framework. There are 3 controllers/methods in here: 'blog/overview', 'blog/addPost', 'blog/deletePost'. When i'm in the methode 'blog/addPost' it calls a view with a form like so:
<form action="blog/overview/" method="post">
<input type="text" name="title" />
<input type="text" name="post" />
<input type="submit" name="addPost" />
</form>
As you can see i'm posting to the methode 'blog/overview'. When the form is posted and the blog is successful added, i want to be able to show an alert that says 'The blog post is succesful added.' in the 'blog/overview' view.
Does it mean that i must check in the methode 'blog/overview' if there was a post, and where it's from? Because i want to do the same thing when i delete a blog post. That means i have to check 2 things already in the 'blog/overview'. And it seems to me this is not the right way to do it.
Does someone please can tell me how this is done?