Re: duplicate entry
| From: | sam rumaizan | Date: | Sat, 07 Apr 2007 11:21:56 +0000 |
| Subject: | Re: duplicate entry | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-27641@lists.php.net to get a copy of this message | ||
Thank you it works fine
Stut <stuttle@gmail.com> wrote: 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 /* wrote:
>
> sam rumaizan wrote:
> > How do I disable Refresh and Back button. to Prevent duplicate entry
>
> Disabling 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?
>
> Enjoy some healthy debate
> in the Yahoo! Answers Food & Drink Q&A.
>
>
---------------------------------
Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.