PHP Redirect vs POST Resend. Help?

I was coding my webblog and hit upon this tiny problem of refreshing a page. I am using the PRG (Post/Redirect/Get) pattern for my blog post where, after submitting a comment, it processes the data and redirects to itself in order to avoid resending of POST data once the user refreshes the page. But due to this I am not able to post a thank you message for the user that leaves a comment.

Here's the basic structure:

<?php
if(submit)
{process_data();
redirect_to_self();}
?>
<div id="post">Post content</div>
<div id="comment">All Comments</div>
<div id="form>
<!--Here's where I had like to show the thank you message-->
<form></form>
</div>

I am not at all with NOT using redirect as resending POST data is a punishable offense.

Any suggestions?

Leave a Reply




Created by DesignForWeb company. All rights reserved © 2007-2010. Check also the iPhone / iPad developers blog
Disclaimer
The materials collected in this blog were taken from open access sources. We try our best to preserve the copyrights of original authors and clearly state the authorship as well as link to original source website where it's possible. Please leave your comment if you feel offended by any post or if you dispose of any information about breach of copyright law in this blog. We will do our best to resolve the situation immediately.