Skip to main content
Inspiring
June 19, 2013
Question

browser back button ...orderID already sent to DB giving duplicate key error

  • June 19, 2013
  • 0 replies
  • 600 views

I have a checkout.php going to a payment gateway using a form and "process payment" button, as the user is sent to the payment gateway hosted page the orderID with other information is sent to the database. The trouble i am having is if the user hits the back button on the brower then returns back to the checkout.php then try and click process payment again the are given the duplicate key as this orderID has already been sent to the database

what options do i have for correcting this. i thought about having a refresh once script then killing the orderID on the checkout.php page. this way if they return to the page via the back button the page should refresh then kill the orderID.

is this a way of doing it or incorrect?

thanks in advance

This topic has been closed for replies.