chronister Posted January 4, 2007 Share Posted January 4, 2007 I am building a "member" section and want to validate the user with a clickable email link that "confirms" they are who they say they are. I scoured Google and found nothing useful, anyone know of a good article or tutorial that shows how to do this?I can do the email part, but I am not sure how I take a url, make it unique, and then use that to confirm their identity.Any help, tutorials, or ideas are appreciated here.thanks,Nate Quote Link to comment Share on other sites More sharing options...
taith Posted January 4, 2007 Share Posted January 4, 2007 1) send them an email with a link to activatepage.php?key=biglongrandomhardtoguesskey, also put that key into the database, when they click on the link in the email, it takes them to that page, finds the random key from the database, and activates the account. Quote Link to comment Share on other sites More sharing options...
mjlogan Posted January 4, 2007 Share Posted January 4, 2007 and for the biglongrandomhardtoguesskey use a md5 hash of a timestamp Quote Link to comment Share on other sites More sharing options...
taith Posted January 4, 2007 Share Posted January 4, 2007 you can do that... or just use a random keygen[code]<?function randomkeys($length){ $pattern = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; for($i=0;$i<$length;$i++) $key .= $pattern{rand(0,62)}; return $key;}?>[/code] Quote Link to comment Share on other sites More sharing options...
chronister Posted January 4, 2007 Author Share Posted January 4, 2007 That's along the lines of what I was thinking.Should I use a new table to keep track of these keys?The members are my existing clients, and I want to give them access to invoices and any other files I provided during their service. I have a clients table, and a users table. The clients table keeps track of all clients, and the users will store the client_id with thier username and pass. Also a field called verified which is a 1 or 0, to keep log of whether they verified or not.So I am wondering if I should have a new table called activations, and store the client_id, with their hash and simply when they click the link, find that entry, if it exists, place a 1 in clients.verified field and then delete that entry in the activations table?Does this sound logical?Thanks for the help. Quote Link to comment Share on other sites More sharing options...
PC Nerd Posted January 4, 2007 Share Posted January 4, 2007 im going to be doing roughly the same thing, although i was going to have a feild called "activated", and the link would point to a page that would add the ranom generated number, in the "activated" field. before the person activates it, that field contains NULL. I hope thats helpfull.... i havent actually tried to do it yet Quote Link to comment Share on other sites More sharing options...
chronister Posted January 5, 2007 Author Share Posted January 5, 2007 Gotcha PC Nerd,Same concept, but implemented a little different.Thanks I will probably try that.Nate Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.