Re: duplicate entry
| From: | Stut | Date: | Sat, 07 Apr 2007 11:04:23 +0000 |
| Subject: | Re: duplicate entry | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-27640@lists.php.net to get a copy of this message | ||
sam rumaizan wrote:
*"If the user hits refresh after submitting the form they will refresh nextpage.php. If they hit back they will be taken back to form.php"* Yes, *If the user hits refresh after submitting the form they will refresh ** *nextpage.php. Which is going to resubmit the data to mysql? (duplicate entry)**No, you didn't read what I wrote. The form submits to formhandler.php which submits the data to MySQL and then redirects to nextpage.php. Nextpage.php *does not* submit any data to MySQL. Read my post again, carefully this time. And please include the list when replying. -Stut
*/Stut <stuttle@gmail.com>/* wrote:sam rumaizan wrote:How do I disable Refresh and Back button. to Prevent duplicate entryDisabling client-side features like refresh and back is not the right way to solve this problem. The most common solution is to redirect the user to the next page from the form handler rather than outputting the next page from the form handler.For example...form.php shows the form, which submits to formhandler.php which processes the form and then does a header('Location: ...') redirect to nextpage.php.If the user hits refresh after submitting the form they will refresh nextpage.php. If they hit back they will be taken back to form.php.-Stut------------------------------------------------------------------------ Food fight? <http://answers.yahoo.com/dir/index;_ylc=X3oDMTFvbGNhMGE3BF9TAzM5NjU0NTEwOARfcwMzOTY1NDUxMDMEc2VjA21haWxfdGFnbGluZQRzbGsDbWFpbF90YWcx?link=ask&sid=396545367> Enjoy some healthy debate in the Yahoo! Answers Food & Drink Q&A. <http://answers.yahoo.com/dir/index;_ylc=X3oDMTFvbGNhMGE3BF9TAzM5NjU0NTEwOARfcwMzOTY1NDUxMDMEc2VjA21haWxfdGFnbGluZQRzbGsDbWFpbF90YWcx?link=ask&sid=396545367>