Reply to Random Password PHP code help req.. only gettinh 3 letters?

Your name:

Reply:


Posted by techcs on 09/14/06 19:58

Hi,

Wondering if anyine can help with the membership PHP script I lifted
from a tutorial. I'm new to PHP and have this system up and running but
my password only come out at three letters and sometime have a space in
them?? Anyway this is the code:

function makeRandomPassword($len = 8,$upper = 1,$number = 1) {
$salt = "abcdefghijklmnopqrstuvwxyz";
$uppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
$numbers = "1234567890";
if ($upper) $salt .= $uppercase;
if ($number) $salt .= $numbers;

srand((double)microtime()*1000000);
$i = 0;
while ($i <= $len) {
$num = rand() % strlen($salt);
$tmp = substr($salt, $num, 1);
$pass = $num . $tmp;
$i++;
};
return $pass;
};

$random_password = makeRandomPassword();

$db_password = md5($random_password);

Any ideas.. I need maybe 5 letters with no spaces...

Thanks
Col

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация