I have a page with a form on it.
If the forms is submitted I redirect to that page again.
On the page I want to display a notification that the data is saved.
I’m looking for a clean way to know that I have to display the notification.
First I thought of adding something to the url:
/page?notify=1
But I don’t like to change the URL.
Then I thought of setting a session before the redirect.
And on the page I check if the session is set, display the notification if it is and unset it.
Would that be an acceptable way of doing it or is there perhaps a better / cleaner way?
I personally think the
?notify=is perfectly acceptable. You’re not going to have spiders crawling that page and since it’s only a confirmation notification you don’t need to worry about the page being indexed. Don’t be afraid of query strings when you’re out of the SEO realm – just look at Amazon.com 🙂Ultimately it comes down to code re-usability and effort of implementation.