Re: Duplicate records added from post forms, easy solutions?



mindwarp wrote:
Hi,

When a user submits / posts data my php script Inserts data into my
database.
If they refresh the script or click back and click submit again I get
duplicate record.

Is there an easy solution to this?

Or do I need to create a hidden field which contains some sort of
unquie data, like a time stamp and have a have a unique field which
stops it adding the record?

Best regards,

Jules.


You could also set a session variable indicating the record had been added.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================
.



Relevant Pages

  • Re: Refresh questions
    ... submitted item repeats each time the refresh is clicked. ... > in my database that stored a submission ID and checking it when the page ... > a hidden field in the form. ... I allowed the submission to be inserted into the ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Refresh questions
    ... submitted item repeats each time the refresh is clicked. ... in my database that stored a submission ID and checking it when the page is ... a hidden field in the form. ... I allowed the submission to be inserted into the ...
    (microsoft.public.dotnet.languages.vb)
  • How to handle user hitting the browser refresh
    ... What are best practices to check to see if a .php script is called for the ... I am playing around with a PHP front-end to a database. ... hits the brower refresh button while at insert.php, the data is re-entered, ... and I end up with a duplicate entry in the database. ...
    (comp.lang.php)
  • Re: Duplicate records added from post forms, easy solutions?
    ... When a user submits / posts data my php script Inserts data into my ... If they refresh the script or click back and click submit again I get ... duplicate record. ... Or do I need to create a hidden field which contains some sort of ...
    (comp.lang.php)
  • Duplicate records added from post forms, easy solutions?
    ... When a user submits / posts data my php script Inserts data into my ... If they refresh the script or click back and click submit again I get ... duplicate record. ... Or do I need to create a hidden field which contains some sort of ...
    (comp.lang.php)