Jump to content

Confirm Registration using Email Link


chronister

Recommended Posts

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
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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]
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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
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.