Home  >  Article  >  Backend Development  >  How to avoid entering information multiple times by scanning the QR code once, or clicking multiple times to confirm multiple redemptions?

How to avoid entering information multiple times by scanning the QR code once, or clicking multiple times to confirm multiple redemptions?

WBOY
WBOYOriginal
2016-12-01 00:25:311581browse

Hello everyone, I am engaged in WeChat development.
Such as the title: How to avoid redeeming prizes multiple times when scanning the QR code or clicking the button to claim the prize.
There are two ways to redeem rewards in offline activities: 1. Scan the QR code 2. Click the redemption button.


No problems occurred during the test (a small company, just a few people testing).
Is this caused by user network problems, program loopholes, or logic problems....
Because there are 9 records with the same timestamp for one user...
I am currently using ajax to pass values. .

Reply content:

Hello everyone, I am engaged in WeChat development.
Such as the title: How to avoid redeeming prizes multiple times when scanning the QR code or clicking the button to claim the prize.
There are two ways to redeem rewards in offline activities: 1. Scan the QR code 2. Click the redemption button.


No problems occurred during the test (a small company, just a few people testing).
Is this caused by user network problems, program loopholes, or logic problems....
Because there are 9 records with the same timestamp for one user...
I am currently using ajax to pass values. .

You have submitted the form repeatedly, and there will be this problem. The web page can disable the button through js after clicking it. After the submission is successful, the ban will be ended and the click will be replied. QR code is the same thing

Each user has an openid. According to the openid, when the user opens the page, he first queries the interface to see if there is data in the database. If so, check this out and display it on the page. A sign indicates whether the prize has been redeemed. If you are interested in the prize individually, If there is a limit on the number, just limit the number of entries.

Isn’t it very easy? Mark the number of times you have redeemed the prize. When you click to deduct the lottery and return the result, another lottery will be naturally rejected because there is no number of times.

Just record the redemption information, openID is different

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn