I am working on a new project and just finished the registration system. The idea is that after the registration, at the first login, the user is asked to provide more information to fill his profile. This consists of 3 or 4 steps, one of them is the ability to invite friends to this website.
I have a few questions about this proces and hope this is the right place to ask.
I am thinking there should be a check on whether this is the first time the user is logged in or not. What is the best way to achieve this? Setting a field(firstlogin) in the mysql database to 1 and checking for it? This way I have to do this check every time the user logs in. Is this the best way to it or is there another better/easier way?
How can I achieve the 3/4 steps profile fill in? Is there an existing framework or something to do this or do I have to code it myself?
Concerning your questions:
Try to take advantage of your current schema before adding more fields. Use a field that is present already on someone's profile. For example, you may have a field called last_login_date
. By default you will have it set to null. If it is null, the user has never logged in before, else the field has a date in it and thus indicates that he has entered at least once before.
If the steps' input information should be stored even if not all steps are complete then you must take record somewhere (database) that he is on X step currently and submit his inputs at each step. On the other hand, if the steps are not that critical, you can store his inputs within the session cookie and submit it after the 4/4 step completion in one go.