Signup : User Email verification through Link

Member Signup page
welcome.php page receives the newly signed users mem_id through query string. Hence it is first checked (integer or not ).
$mem_id=$_GET['mem_id'];
if(!is_numeric($mem_id)){
echo "Data Error";
exit;
}
Using this mem_id we collect userid, email address and status from the mem_table. The status column of member table will have one of the three options.

A : Just signed and verification mail is not posted to the registered email address
B : Verification mail is posted to registered email and the same is pending for confirmation
C : Confirmation received and the email address is verified so member can login

We have collected the details by using SELECT query.
if($stmt = $connection->prepare("SELECT userid,email from mem_signup   WHERE mem_id=? and status='A'")){
	 ----
 }
We create a randomly generated word ( as token ) and store the same along with mem_id, userid, email in a table mem_status. After storing we will collect the unique identification number from auto increment field of the table. This is know as status_id .

After successful signup by user , we have to verify the email address submitted by user by sending a link with one activation key. This link will contain following data which the user needs to post back to server by clicking the validation link.

DataDetails
status_id: Unique identification of the record against which the details are posted. ( from mem_status table )
mem_id : Unique identification of the user ( from mem_signup table )
userid : Unique identification of the user ( from mem_signup table )
email : email address from where the data has come ( from mem_signup table )
word : randomly generated word as token which is matched against record to establish authenticity. ( generated and stored in mem_status table )
So while signup, the status in mem_table is kept as A. Now we will collect the matching userid , email , and status from mem_table and create a link using them. These details we will store in mem_status table along with randomly generated word.

Here is a formatted link containing the details of the user which is posted to its email address for verification.
http://example.com/f/si_conf.php?mem_id=14&email=userid@gmail.com&userid=myuserid&status_id=16&word=a498656b1e61a93ef81ad86006ccc8b2
Once the user clicks the link from its Inbox, the link along with the data is posted to the server for verification. We will learn this in our next tutorial


plus2net.com



Post your comments , suggestion , error , requirements etc here .







Most Popular JQuery Scripts

1

Two dependant list boxes

2

Calendar with Date Selection

3

Data change by Slider

4

Show & Hide element
We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
©2000-2020 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer