ZedPass


SUBMITTED BY: Guest

DATE: May 2, 2014, 9:50 p.m.

FORMAT: PHP

SIZE: 708 Bytes

HITS: 1308

  1. <?php
  2. // Code by KaosKaizer of DragonPrime.NET
  3. // This script is to create passwords randomly. Use it with your custom registration script.
  4. function zedpass($strlen=7,$nums=false,$caps=true){
  5. if ($strlen < 7) $strlen = 7; // set the default as the lowest accepted length
  6. if ($strlen > 75) $strlen = 75; // do not allow the length to exceed 75
  7. $low = "abcdefghijklmnopqrstuvwxyz";
  8. $cap = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  9. $num = "0123456789";
  10. $fin = $low;
  11. if ($caps === true) $fin .= $cap;
  12. if ($nums === true) $fin .= $num;
  13. $password = "";
  14. for ($i=0; $i < $strlen; $i++){
  15. $password .= $fin[rand(0,strlen($fin))];
  16. }
  17. return $password;
  18. }
  19. ?>

comments powered by Disqus