RE: [PHP] How can I fix that

From: Date: Mon, 13 Dec 2004 11:04:14 +0000
Subject: RE: [PHP] How can I fix that
Groups: php.general 
Request: Send a blank email to php-general+get-204151@lists.php.net to get a copy of this message
I've just had this exact problem. The solution as far as I found is one of the following: 1. Keep a $_SESSION going and set a flag, then on a re-post you can check the flag to see if it's set and hopefully spot the re-post. 2. Check to see if what you're about to enter is already there, chances are it's a repost - this only works for certain sorts of applications though. 3. Divert the user to a different page using header() so that if they hit refresh they only refresh the thankyou page and not the post - this doesn't stop 'back' for screwing things though. 4. Use java to prevent the history, I've found this example (not tested it) <script language="php"> history.forward(); </script> Hope this helps Matthew -----Original Message----- From: Aalee [mailto:ayyaali@hotmail.com] Sent: 13 December 2004 09:50 To: php-general@lists.php.net Subject: [PHP] How can I fix that Hi there everyone... I did a form to add data to a database and it works fine. Once the data is entered its gives a thankyou message. But the problem is, if I refresh this thankyou page, the data is entered again into the database. Why is it doing so. I couldnt think of a way to fix it. Help... cheers -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ________________________________________________________________________ This message has been checked for all known viruses by the CitC Virus Scanning Service powered by SkyLabs. For further information visit http://www.citc.it ___ ________________________________________________________________________ This message has been checked for all known viruses by the CitC Virus Scanning Service powered by SkyLabs. For further information visit http://www.citc.it ___

« previous php.general (#204151) next »