Javascript-php Registration Invitation Code

Source: Internet
Author: User

When registering,

Judge this invitation code registrant has an invitation code, fill in the invitation code judgment is not correct, no invitation code can not fill, this judgment how to write? Request to inform

Reply content:

When registering,

Judge this invitation code registrant has an invitation code, fill in the invitation code judgment is not correct, no invitation code can not fill, this judgment how to write? Request to inform

Since there is an invitation code, it means that your backstage or database or cache or other places have a normal valid invitation code, yes No. Then the user only in the form of the invitation code to fill in the content, regardless of what you get the user to fill out the invitation code, and your background of the normal effective invitation code to compare, if the equivalent is valid, then the invitation code to kill or become invalid can. If you don't fill it out, don't fill it out.

Not very understand your meaning, according to my understanding, you want the effect is, has filled out the validation is correct, did not fill it is not verified?
Data to the backend do a non-null verification

$code = $_POST['code'];//邀请码if(!empty($code)){    //去数据库查询邀请码正确性    ....}

PHP If...else Syntax Basics

The invitation code sure you have in the database, and then if he entered the invitation code, check the invitation code there is no, if there is no input on the tube, directly down execution

I think the general logic is this,
Accept the data in the background, if you accept the invitation code field is empty, then ignore, with no invitation code to check the logic
If the accepted invitation code is not empty, you should have an invitation code to detect
So the previous section of the page need to give a hint, such as: The Invitation code input box, hint: No invitation code is not filled


  
   

希望对你有帮助

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