Webmaster общности: Predpriemach.com | SearchEngines.bg

    Генериране на произволна парола

    Автор: mcfe

    Генериране на произволна парола!
    Става чрез скрипта rp

    function rp() {
    chars = new Array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","T","U","V","W","X","Y","Z");
    var num_of_chars = 6;
    var pass = "";
    
    for(i = 0; i < num_of_chars; i++) {
    var random_pos = Math.floor(Math.random() * chars.length);
    pass = pass + chars[random_pos];
    }
    
    var enter_pass = prompt(l_password,pass);
    
    if (enter_pass) {
    document.usercp.chpassword.value = pass;
    document.usercp.passagain.value = pass;
    }
    }
    var l_password="Copy and Paste your new password below:";

    Създавате нов файл наречен index.php или index.html
    и поставяте в него

    <html>
    <head>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1251">
    <link rel="stylesheet" href="style.css" type="text/css">
    <script type="text/javascript">
    function rp() {
    chars = new Array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","T","U","V","W","X","Y","Z");
    var num_of_chars = 6;
    var pass = "";
    
    for(i = 0; i < num_of_chars; i++) {
    var random_pos = Math.floor(Math.random() * chars.length);
    pass = pass + chars[random_pos];
    }
    
    var enter_pass = prompt(l_password,pass);
    
    if (enter_pass) {
    document.usercp.chpassword.value = pass;
    document.usercp.passagain.value = pass;
    }
    }
    var l_password="Copy and Paste your new password below:";</script>
    </head>
    <body>
    <input type="button" value="Generate Random Password" onclick="rp()">
    </body>
    </html>

    И това е, за да изберете колко символа да генерира променете това

    var num_of_chars = 6;

    или по скоро числото и така вместо 6 ако го направите на 7 ще генерира седем символна парола

    Оставете коментар