Preventing double HTTP POST

前端 未结 11 816
死守一世寂寞
死守一世寂寞 2020-12-29 05:23

I have made a little app for signing up for an event. User input their data and click \"sign me in\".

Now sometimes people are double in the database, the exact sam

11条回答
  •  梦毁少年i
    2020-12-29 06:19

    Client side alteration is a common technique:

    • Disable submit button
    • Change the screen to a "please wait" screen
    • If the form was modal, changing the screen back to their usual process (this has the benefit of making things look really slick)

    But it's not perfect. It all relies on JS being available and if that's not the case, without back-end duplication detection, you'll get duplicates still.

    So my advice is to develop some sort of detection behind the scenes and then improve your form to stop people with JS being able to double-submit.

提交回复
热议问题