1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
<? echo $password=generatepassword(); function generatepassword() { $chars = "abcdefghijklmnopqrstuvwxyz"; $nums = "0123456789"; $syms = "@$!*"; $finalpassword = strtoupper(substr($chars,mt_rand(0, 25),1)); $finalpassword .= substr($chars,mt_rand(0, 25),1); $finalpassword .= substr($chars,mt_rand(0, 25),1); $finalpassword .= substr($chars,mt_rand(0, 25),1); $finalpassword .= substr($nums,mt_rand(0, 9),1); $finalpassword .= substr($syms,mt_rand(0,3),1); $finalpassword .= substr($nums,mt_rand(0, 9),1); $finalpassword .= substr($nums,mt_rand(0, 9),1); $finalpassword .= substr($syms,mt_rand(0,3),1); return $finalpassword; } ?> |