Jump to content

username check question


Darkranger85

Recommended Posts

Hey all,

 

In my user registration system I'm trying to figure something out.

 

When the user puts in his information and hits submit it goes into a temporary user table while it waits for the user to click on the activation code in the email that is sent out. Once they click on it it's then transferred into the user table.

 

Now, I have a few questions:

 

1. Should the user check on the registration screen check both tables for a username match?

 

What if someone starts a registration but never activates it. That username, though not in use, is now taken up in the tempuser table.

 

2. Should the information in the temporary table be cleared after it is moved into the regular table?

 

Thanks guys! :)

Link to comment
Share on other sites

There are a few approaches that you can do, but the simplist would be to keep them all in the users table, whether activated or not.  Have a column called "activated" as a tinyint and default to 0 for being inactive, and set to 1 for being active.  You then don't have to worry about comparing tables or moving and deleting from other tables.

Link to comment
Share on other sites

I have done these before and I also used a single table for users, like Eiolon said. I also use a 'Status' field in my table, which is used for more than just registered/not registered. I would do something like -1 for 'deleted' users, 0 for unverified email users, 1 for regular users..... up to 5 for admins. Then throughout my code, I could check against that status to see how much of the page to display (more for admins, obviously). etc.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.