|
#1
|
||||
|
||||
[MOD] Random Password Generator
This will generate a random password when you signup.
In signup.php after: PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
AFTER DOING THAT WE NEED TO ADD THE BUTTON: In my case after: PHP Code:
PHP Code:
NOTE: If you want to change the password lenght just edit this line where 7 is the number of letters generated: PHP Code:
PHP Code:
__________________
|
#2
|
|||
|
|||
pass = randomPassword('6');
chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW XYZ234567890"; pass = randomUsername('12'); chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW XYZ234567890"; Bump: PHP Code:<br/> <script language="JavaScript"> function randomPassword(length) { chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW XYZ234567890"; pass = ""; for(x=0;x<length;x++) { i = Math.floor(Math.random() * 62); pass += chars.charAt(i); } return pass; } function randomPass() { pass = randomPassword('8'); document.getElementById('input').value = pass; document.getElementById('input').type = "text"; document.getElementById('input').value = pass; } function randomUsername(length) { chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW XYZ234567890"; pass = ""; for(x=0;x<length;x++) { i = Math.floor(Math.random() * 62); pass += chars.charAt(i); } return pass; } function randomUsername() { pass = randomPassword('16'); document.getElementById('input2').value = pass; document.getElementById('input2').type = "text"; document.getElementById('input2').value = pass; } </script> Username: <input id="input2" type="button" value="Generate" onclick="randomUsername();" /> Last edited by BamBam0077; 30th November 2021 at 02:00. |
Tags |
generator , mod , password , random |
|
|