Jump to content

User E-Mail Verificatio ?


techiefreak05

Recommended Posts

I have a social network that is pretty much complete, but I don't want people to make obscure accounts, so i was thinking e-mail verification. I have an idea on how to implement this, what do you think?

 

1. When a user registeres create a really long hard to guess "token" of some sort and store it in the DB

2. When they recieve the e-mail after signup, they click a link that sends them to the page with their token in the URL, and it "verfies" the account.

 

what should i use for the token?

Link to comment
https://forums.phpfreaks.com/topic/41696-user-e-mail-verificatio/
Share on other sites

Just knocked this up...

 

<?php

  function generatetoken($length) {
    $letters = range('a','z');
    for ($i = 0;$i < $length;$i++) {
      $token .= $letters[rand(1,26)];
    
    }
    return $token;

  }

  $token = generatetoken(40);

?>

 

Might give you some ideas.

Archived

This topic is now archived and is closed to further replies.

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