php - When sending an e-mail to confirm user registration, at what point is the username/password stored in the database? -
i'm designing user registration form , working on sending confirmation e-mail. script responsible adding username/password/e-mail address etc. database getting rather long , wanted break code responsible e-mails file. thinking how 2 scripts work together; database script include e-mail script or redirect , pass arguments. or have backwards? e-mail script including/calling database script?
what happens first? 1) e-mail containing account activation link sent out before data added database or 2)is data put in database right away "activated" field set false , when user clicks on link in e-mail field updated true 3)or other way?
#2, other users don't take username twice. if don't save information instantly, other users can activate account , you'll have errors that.
most websites have expire on activation usernames can't held long period of time.
a column state
such user/banned/confirmed/unactivated necessary keep track of has activated , has not. cron job used sweep database old inactive users, basing on timestamp of registration.
Comments
Post a Comment