Many sites send you a temporary password after u sign up with them. Here is is how you too can do that PHP: function TempPassword($tp_len) { $pstring = "aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWXxYyZz0123456789"; $plen = strlen($pstring); for ($i = 1; $i <= $tp_len; $i++) { $start = rand(0,$plen); $temp_password.= substr($pstring, $start, 1); } return $temp_password; } Example: PHP: $tp=TempPassword("9"); Result: Code: $tp= Ab72Pz3Rs
I have some different idea about generating random password. You can see that here http://www.go4expert.com/showthread.php?t=269 Thanks Shabbir Bhimani