Account Verification

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Zeyber
Forum Newbie
Posts: 16
Joined: Wed Sep 26, 2007 9:23 pm

Account Verification

Post by Zeyber »

How would you make a random number generator for something like a verification code? Is there an easy way to randomly generate numbers or letters?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

As is often the case, the online manual may help.

http://www.php.net/manual/en/function.rand.php

There are some user examples that may be of interest.
(#10850)
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

rand(), mt_rand(), md5(), sha1(), hash(), uniqid(), substr() could all be useful for generating random strings.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
shylor
Forum Newbie
Posts: 13
Joined: Thu Sep 27, 2007 12:52 pm

Post by shylor »

I use mt_rand() with at md5() on top. then stuff it into the database until the user clicks the link!
Zeyber
Forum Newbie
Posts: 16
Joined: Wed Sep 26, 2007 9:23 pm

Post by Zeyber »

Cool thanks!
Post Reply