RE: [PHP-DB] Re: Page refresh and database updation
| From: | php at swimwebs dot com | Date: | Tue, 26 Sep 2006 16:12:39 +0000 |
| Subject: | RE: [PHP-DB] Re: Page refresh and database updation | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-42397@lists.php.net to get a copy of this message | ||
You can redirect the page to the result page after the data is saved, using header("Location:
successpage.php"). I've used this on several sites. It's a little extra work but
does prevent the reposting of data.
Another option is to use AJAX to send the data to the webserver and then have the javascript open
the result page after the update is complete. I do this on several of my webpages and it works
great.
>Tamkhane, Pravin wrote:
>> Hi All,
>> I am a PHP newbie. I am using HTTP POST request to send some data to
>> Apache and then using MySql to store that information. Once information
>> is stored in MySql DB successfully, I display a result page. But the
>> problem I am facing is that, if I refresh the result page displayed
>> after database updation, the information is stored again in database
>> which I don't want to. Please guide me on how I can avoid duplication of
>> information in database on refreshing the page. Thanks in advance!
>>
>> Regards,
>> Pravin
>You probly want to use a seperate script to build the results, or even a
>PEAR template mechanism.
>
>/cs
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>