Jump to content

new record inserting on refresh the form


sunilvadranapu

Recommended Posts

Hi,

  I have one form for collecting feedback from users. On submitting the form, it inserts a record in to the database. I am using Postgresql as database. This is working fine for  me. but, if I refresh the form after inserting a record, again it is inserting a new record with the same POST data. For each refresh, a new record is going into the database. How to overcome this problem. any idea????

 

-SunilKumar

Link to comment
https://forums.phpfreaks.com/topic/46705-new-record-inserting-on-refresh-the-form/
Share on other sites

We can do that but it involves fetching all records from database and comparing with POST data which takes much time to process. If we are able to check at front end itself that would be better i think. Can't we process /eliminate this at front end itself? any ideas???

 

-SunilKumar V

Now keep a flow like this

 

1. create a file form.php in which place form and feilds

    <form name=a action="add.php">

.............

2. now in add.php file dont database operation and aftrer that you redirect to amother file like this

 

....

.....

header("location:thank_you_for_feedback.php");

or

header("location:form.php");

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.