Free Web Hosting PHP/mySQL
GlobalWeb.com.ru Forum Index GlobalWeb.com.ru
Free Web Hosting :: Commercial Web Hosting :: PHP/mySQL :: CGI/Perl
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Random Password Generator

 
Post new topic   Reply to topic    GlobalWeb.com.ru Forum Index -> Howtos
Author Message
Wesley Geysels



Joined: 01 Mar 2004
Posts: 121
Location: Belgium

PostPosted: Mon Mar 01, 2004 1:31 am    Post subject: Random Password Generator Reply with quote

<?php
function random_char($type)
{
$lenght = sizeof($type);
$position = mt_rand(0, $lenght-1);
return($type[$position]);
}

function random_password($n)
{
mt_srand((double)microtime() * 1000000);

$vowel = array("b","d","f","g","h","j","k","l","m","n","p","r","s","t","v","w","x","z");
$doublevowel = array("bl","br","cl","cr","dr","fl","fr","gl","gn","gr","kl","kn","kr", "ph", "pr", "sh", "sj", "sk", "sl", "sm", "sn", "sp", "st", "tr", "vl", "vr", "zw");
$consonant = array("a","e","i","o","u");
$number = array("1","2","3","4","5","6","7","8","9","0");

for ($i = 0; $i < $n; $i++)
{
$password = "";
$password .= random_char($doublevowel);
$password .= random_char($consonant);
$password .= random_char($vowel);
$password .= random_char($consonant);
$password .= random_char($vowel);
$password .= random_char($number);
$password .= random_char($number);
print ("<LI>$password</LI>\n");
}
}

print("<HTML>\n");
print("<HEAD>\n");
print("<TITLE>Randow Password Generator</TITLE>");
print("</HEAD>\n");
print("<BODY>\n");
print ("<FORM action=\"$PHP_SELF\" method=\"post\">\n");
print ("How many passwords do you want to regenerate?\n");
print ("<INPUT type=\"text\" size=\"3\" name=\"n\">\n");
print ("<INPUT type=\"submit\" value=\"Go!\">\n");
print ("<UL>\n");
random_password($n);
print ("</UL>\n");
print("</BODY>\n");
print("</HTML>\n");

// End Script
?>
Back to top
View user's profile Send private message Send e-mail MSN Messenger
sam
Banned


Joined: 01 Mar 2004
Posts: 51
Location: IL

PostPosted: Mon Mar 01, 2004 1:28 pm    Post subject: Reply with quote

I like it
_________________
Back to top
View user's profile Send private message Visit poster's website
macabist
Banned


Joined: 01 Mar 2004
Posts: 35

PostPosted: Mon Mar 01, 2004 1:30 pm    Post subject: Reply with quote

Cool!!!
THX man
Back to top
View user's profile Send private message
i03m



Joined: 02 Mar 2004
Posts: 6

PostPosted: Wed Mar 03, 2004 1:00 am    Post subject: Reply with quote

I love this code. COOOOOOOOL Wink
Back to top
View user's profile Send private message
chandan
Site Admin


Joined: 29 Feb 2004
Posts: 317
Location: India

PostPosted: Wed Mar 03, 2004 1:20 am    Post subject: Reply with quote

posts like "cool", "i like it", "this is nice".... etc, will not be counted as valid posts when u apply for hosting....
_________________
get free PHP scripts

Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    GlobalWeb.com.ru Forum Index -> Howtos All times are GMT
Page 1 of 1

 


Free Web Hosting, Commercial Web Hosting, PHP/mySQL Copyright © 2009
Free Scripts Directory | Free Software Downloads | Newsgroups Directory | Optel.net | Mirroraty | Cruised.net | Hardware Keylogger