Questions related to PHP iterative validation

Source: Internet
Author: User
Problems with PHP iterative validation
I now want to do a user registration of things, but users and passwords do not need the user to fill out, is the system generated I wrote a function, with Mt_rand do, so afraid of repetition, in the class inside wrote a static method, can be used, myclass::chkeuser verification, See is not already have this user name password, but I think the value of verification once, not, if Next, or repeat it, is not the verification, no repetition so far, think of the iteration, but how to write, the head blurred, ask you heroes?

Share to:


------Solution--------------------
First go to the database to insert the user, get the user unique ID, and then the user equals User+id value, directly with the user ID confusion generated.
For example, user ID = 3090, the user name is user3090, and the password is MD5 (' One of your private keys '. 3090) So it certainly won't repeat
------Solution--------------------
I don't know what you're trying to verify. It's okay to repeat the password.
User authentication is not a select? Get the number, >0, repeat.

What's the next point? The next random value? Put all the user names put into the array, inarray do not discriminate, not iterative AH

  • 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.