Файл: WM-Koder/page/21/passgen/index.php
Строк: 38
<?php
require '../../../system/sid.php';
require '../../../system/config.php';
include '../../../system/user.php';
include '../../../system/head.php';
whorm(0, 'work');
echo $div_title . 'Генератор паролей' . $div_end;
echo '<div class="menu">';
$i = file_get_contents('prosm.txt');
$i = intval($i) + 1;
$file = fopen('prosm.txt', 'w');
fputs($file, $i);
fclose($file);
echo '<form action="'.$_SERVER['PHP_SELF'].'" method="post" name="genps">';
if (isset($_POST['genps'])) {
$genps = intval($_POST['genps']) + 1;
if ($genps == 1 or $genps > 41) {
err('Введены не цифры или длинна пароля слишком велика! Максимум 40 символов!');
} else {
$abc = array('1' => 'A','2' => 'a','3' => 'B','4' => 'b','5' => 'C','6' => 'c','7' => 'D','8' => 'd','9' => 'E','10' => 'e','11' => 'F','12' => 'f','13' => 'G','14' => 'g','15' => 'H','16' => 'H','17' => 'J','18' => 'j','19' => 'K','20' => 'k','21' => 'L','22' => 'l','23' => 'M','24' => 'm','24' => 'N','25' => 'n','26' => 'O','27' => 'o','28' => 'P','29' => 'p','30' => 'Q','31' => 'q','32' => 'R','33' => 'r','34' => 'S','35' => 's','36' => 'T','37' => 't','38' => 'U','39' => 'u','40' => 'V','41' => 'v','42' => 'W','43' => 'w','44' => 'X','45' => 'x','46' => 'Y','47' => 'y','48' => 'Z','49' => 'z','50' => '1','51' => '2','52' => '3','53' => '4','54' => '6','55' => '7','56' => '8','57' => '9','58' => '0');
$r = mt_rand(0, 99999);
$f = $r . '.txt';
$file = fopen($f, 'a+');
if ($file) {
echo 'Ваш пароль: ';
$c = sizeof($abc);
for($i = 1; $i < $genps; ++$i) {
$r = rand(1, $c);
echo '<b>' . $abc[$r] . '</b>';
fputs($file,$abc[$r]);
}
fclose($file);
$file = file_get_contents($f);
echo '<br/>Или скопируйте его:<br/>
<textarea class="c" cols="10" rows="1">' . $file . '</textarea><br/>';
unlink($f);
} else {
err('Поставьте права на папку со скриптом 777');
}
}
$genps = $genps - 1;
}
echo '<label>Длина желаемого пароля:</label><br/>
<input class="c" name="genps" type="text" maxlength="3" value="'.$genps.'" />симв.<br/>
<input class="d" type="submit" value="Придумать" />
</form>
</div><div class="menu"><a class="ssyl2" href="/page/21/">В Раздел</a></div>';
include '../../../system/foot.php';
?>