How to restrict the verification code only once-php Tutorial

Source: Internet
Author: User
How to restrict the verification code can be used only once. assuming there is an activity, we have implemented that each account can only participate once. If a person obtains a verification code and submits the same verification code, he or she switches to another account to participate in the activity. Can this approach be implemented? if so, how can we avoid it! The verification code is encrypted and bound to the account. do you verify the verification code when submitting the verification code? ------ Solution --- how to restrict the verification code only once

Assuming there is an activity, we have implemented that each account can only participate once.
If a person obtains a verification code and submits the same verification code, he or she switches to another account to participate in the activity.
Can this approach be implemented? if so, how can we avoid it! The verification code is encrypted and bound to the account. do you verify the verification code when submitting the verification code?


------ Solution --------------------
You can do this. add A verification code field to the database to set A unique attribute. if A logs on to the database, the verification code is saved to the verification code of account A. If this is not the case, it can be bound.
------ Solution --------------------
I do not know your specific implementation. we recommend that you destroy the current value immediately after the user enters the verification code.
The verification code can be longer, such as 5-6 digits, to reduce the duplication caused by the mechanism.
Hope to help you !!!
------ Solution --------------------
In this case, provide an idea.

Write the used verification code to the data table. each time the user submits the verification code, the database is queried. one field is used to determine whether the verification code is used. This prevents repeated verification codes, similar to the invitation code.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.