CREATE TABLE Member
(
memberID int IDENTITY (2480,39) PRIMARY KEY,
memberName nvarchar(70) NOT NULL,
password nvarchar(30) NOT NULL,
eMail nvarchar(100) NOT NULL,
notify bit NOT NULL,
isActive bit NOT NULL,
lastLogin datetime DEFAULT GetDate(),
dateCreated datetime DEFAULT GetDate() NOT NULL
);
Once user fill registration form that consists of:
memberName, password, email and check/uncheck notify box then click submit. The values will be stored in the above table with isActive equals to False.
Email will be sent to user for activation, once activated, isActive will equal to true.
1. How can i send an activation link to the email and then change isActive to True once link is clicked? I tried to solve it, i just didn’t get it yet. Can you help please.
2. Do i have to add a new column/change schema to achieve step 1. If so, please advise.
One simple way is to have a GUID activation code in this table, and include that activation code in the email (either as a query string parameter in the link, or have the user copy/paste when they get to the site).
When that GUID is posted, then you know the email was received, and you can activate the user.