Signup : Storing Member data
plus-signup-v2 This script requires advance knownedge of PHP, MySQL and JQuery. For the basic script you can check plus-signup-v1We will start with a form for members to signup and store their login details in a MySQL database table. We will call this table mem_signup table: This table will store all details of meber including userid and password for login. Following Inputs are required for the page. ( Out of all user inputs, userid, password, email , captcha and terms and conditions are validated )
Displaying error messageUsing CSS the border colour of the element is changed to red and message is displayed saying about the failure of validation. Here is the code for managing userid.
Matching Password conditionsWe can guide the user to create a complex password for better security. The chars combination of password can be checked at front end and message can be displayed to guide the user.
Server side validation before storing details in database tableOnce the client side validation is complete the data is allowed to posted to server side.
At the server end we will check these points before storing in our members table.
Userid must be alphanumeric characters.
Userid minimum length is 6 and maximum length is 15
Checking email address
User clicked the Terms and conditions
Length of password
Both passwords should match
userid not in use
Email address not in use
Storing member details in database tableOnce the validation is passed ( all inputs are fine ) then we will store the member details in a database table mem_signup. Our table mem_signup will have one unique auto increment field showing the mem_id ( membership_id) . Every member successful signup will have one such unique id.
Storing PasswordWe will encrypt the user entered password and store it in our table.
We can check ( or compare ) at the time of login by using password_verify()
Welcome messageAfter signup we need to post one welcome message to registered id with a link to verify the ownership of the email address. We will learn that in our next tutorial Welcome message and verification of email address.
Features with Tutorials Signup page with all validations Welcome page after signup asking user to check & verify email Verification of Email address Login Page after verifiction of email Home page for logged in users members Logout page to destroy session variables
This article is written by plus2net.com team.