Generating confirmation code for an email confirmation

kdharshan

New Member
Using PHP, what are some ways to generate a random confirmation code that can be stored in a DB and be used for email confirmation? I can't for the life of me think of a way to generate a unique number that can be generated from a user's profile. That way I can use a function to make the number small enough to be included in the URL (see this link). Remember, the user has to click on the link to "confirm/activate" his/her account. If I can't use numbers, I have no problems using both letters and numbers.With that said, I've tried hashing the username along with a "salt" to generate the random code. I know there has to be a better way, so let's hear it.
 
Back
Top