• Welcome to Valhalla Legends Archive.
 

How should I make my email verification?

Started by warz, June 19, 2006, 12:26 PM

Previous topic - Next topic

PaiD


Joe[x86]

God's gift to the world!
function generateRandomString($length) {
$values = array("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o",
"p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G",
"H", "I", "J", "K", "L", "M", "N", "O","P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y",
"Z", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0");
$random_string = "";
for($i=0; $i < $length; $i++) {
$random_string .= $values[mt_rand(0,61)];
}
return $random_string;
}


When creating the code, just call generateRandomString(32). The easiest way to do this would be to store it in the database until they try to activate, because any way that you could create the same string twice without storing it could be guessed and cracked.
Quote from: brew on April 25, 2007, 07:33 PM
that made me feel like a total idiot. this entire thing was useless.

Kp

It'd be shorter to write@values = ("a" .. "z", "A" .. "Z", "0" .. "9");
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

rabbit

PHP doesn't have that functionality, but close.  Use the range() function.
Grif: Yeah, and the people in the red states are mad because the people in the blue states are mean to them and want them to pay money for roads and schools instead of cool things like NASCAR and shotguns.  Also, there's something about ketchup in there.

warz

Quote from: Savior on June 26, 2006, 11:56 PM
Warz: Why is your site forbidden?

Sorry, it's currently at www.rafm.org/en/ - i didnt want people messing with it while it was being constructed. It's got a little bit of functionality now, but it's still missing the main purpose. Currently you can register, login and create a group, join a group and view group information.