Temporary password in PHP


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. function randompassword($len)
  2. {
  3. $pass = '';
  4. $lchar = 0;
  5. $char = 0;
  6. for($i = 0; $i < $len; $i++)
  7. {
  8. while($char == $lchar)
  9. {
  10. $char = rand(48, 109);
  11. if($char > 57) $char += 7;
  12. if($char > 90) $char += 6;
  13. }
  14. $pass .= chr($char);
  15. $lchar = $char;
  16. }
  17. return $pass;
  18. }

URL: http://www.go4expert.com/forums/showthread.php?t=269

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.