RE: [PHP] Form duplicate post problem

From: Date: Sun, 29 Dec 2002 02:44:49 +0000
Subject: RE: [PHP] Form duplicate post problem
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-129561@lists.php.net to get a copy of this message
> >to a new page that displays the success notices etc and if they > >do a back or a refresh nothing will happen as the POST data > >is on the previous now "removed" from history page. > > I understand, but the reason i am trying to stick with just one > page is that i want it to be practical. I mean, the moment the user clicks > "submit" the page reloads and shows his comment immediately, and give him > the functionality of pressing refresh to see if anyone else commented in > the meantime. > Also, by using a different page, even with a redirect back to the > original, might take a little while, since the original is a bit heavy on > the download side. ;-) You can still use one page and use a "middle-man" technique. The part that processes the form input would redirect back to itself after the data is inserted into the database, thus getting rid of the post data. So subsequent refreshes of the page will refresh without attempting to repost the data. The only other way to do it is to check the data you're about to insert to see if it's already there. If it is, then don't insert it... ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/

« previous php.general (#129561) next »