Advertisement
desislava_topuzakova

6. Password Generator

Apr 16th, 2018
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.98 KB | None | 0 0
  1. <?php
  2. $first = readline();
  3. $second = readline();
  4. strtoupper($second);
  5. $third = readline();
  6. strtolower($third);
  7. $fourth = readline();
  8. $fifth = readline();
  9. $sixth = readline();
  10.  
  11. $num = readline();
  12.  
  13.        $counter = 0;
  14.         for ($i = 1; $i <= $first; $i++) {
  15.             for ($j = 'A'; $j <= $second; $j++) {
  16.                 for ($k = 'a'; $k <= $third; $k++) {
  17.                     for ($l = 1; $l <= $fourth; $l++) {
  18.                         for ($m = 1; $m <= $fifth; $m++) {
  19.                             for ($o = 1; $o <= $sixth; $o++) {
  20.                                 $counter++;
  21.                                 if($counter == $num) {
  22.                                   printf("%s%s%s%s%s%s",$i,$j,$k,$l,$m,$o);
  23.  
  24.                                 }
  25.                             }
  26.                         }
  27.                     }
  28.                 }
  29.             }
  30.         }
  31.  
  32.         if ($counter < $num) {
  33.             echo("No password on this position");
  34.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement