Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

Engaged ,
Jun 19, 2013 Jun 19, 2013

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

TOPICS
Server side applications
603
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation