SitePoint Sponsor |
|
User Tag List
Results 1 to 7 of 7
Thread: Password Creation
-
Dec 21, 2000, 11:52 #1
- Join Date
- Dec 2000
- Location
- Orange County, Ca
- Posts
- 288
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I am using php/mysql and I want to generate passwords (combination of letters and numbers) automatically. How could I go about doing this?
Wordpress Auto Installer
www.webproco.com
-
Dec 21, 2000, 12:23 #2
- Join Date
- Aug 2000
- Location
- Silicon Valley
- Posts
- 2,241
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
There are quite a lot of random password generators at zend.com (Code Library/Algorithm)
- Son Nguyen
AdSpeed.com - Ad Serving and Ad Management Made Easy
-
Dec 21, 2000, 12:38 #3
- Join Date
- Jul 1999
- Location
- Derbyshire, UK
- Posts
- 4,411
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
$password_length = 10;
srand ((double) microtime() * 1000000);
$password = md5 (uniqid (rand()));
$password = substr( $password, 0, $password_length );
Would give you a password that is 10 chars long. You can change how long you want it to be by changing the $password_length variable.Karl Austin :: Profile :: KDA Web Services Ltd.
Business Web Hosting :: Managed Dedicated Hosting
Call 0800 542 9764 today and ask how we can help your business grow.
-
Dec 21, 2000, 13:47 #4
- Join Date
- Dec 2000
- Location
- Orange County, Ca
- Posts
- 288
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanks guys, this is just what I needed.
Wordpress Auto Installer
www.webproco.com
-
Dec 21, 2000, 14:47 #5
- Join Date
- Aug 1999
- Location
- Pittsburgh, PA, USA
- Posts
- 3,910
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Cool - thanks for the code man - I don't know if I'll ever need it, but that's something I'd always wondered about - the password is based on the timestamp, right?
-
Dec 21, 2000, 16:29 #6
- Join Date
- Dec 2000
- Location
- The flat edge of the world
- Posts
- 838
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Here's an article on generating prononceable passwords:
http://www.phpbuilder.com/columns/jesus19990502.php3
-
Dec 22, 2000, 02:07 #7
- Join Date
- May 2000
- Location
- Canada
- Posts
- 533
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
i generally take an array of characters I like (letters, numbers), pick a random number a couple times, pick letters out of the array , ofcourse using srand, etc, etc... seems to work good, another thing to try is to make an MD5 hash off something random, and pick a bunch of characters from it
------------------
SitePoint Community Moderator
[b]myPHPhost.com[b] - we ARE php, we know PHP, we provide PHP!
Bookmarks