RE: How can I fix that

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 
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@xxxxxxxxxxx] 
Sent: 13 December 2004 09:50
To: php-general@xxxxxxxxxxxxx
Subject:  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

___

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux