Bravo List
Register
Go Back   > Bravo List > P2P > Forum > Downloads
Reply
  #1  
Old 15th November 2016, 16:24
Chez's Avatar
Chez Chez is offline
Senior Member
 
Join Date: Sep 2011
P2P
Posts: 278
Default [MOD] Random Password Generator
This will generate a random password when you signup.

Click the image to open in full size.

In signup.php after:

PHP Code:
if ($arr[0] >= $maxusers)
        die(
"The current user account limit (" number_format($maxusers) . ") has been reached. Inactive accounts are pruned all the time, please check back again later...");

?> 
ADD

PHP Code:
<script language="JavaScript"> function randomPassword(length) {   chars "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ234567890";   pass "";   for(x=0;x<length;x++)   {     Math.floor(Math.random() * 62);     pass += chars.charAt(i);   }   return pass; } function randomPass() {   pass randomPassword('7');   document.getElementById('p1').value pass;   document.getElementById('p1').type "text";   document.getElementById('p2').value pass; } </script> 
THEN FIND:


PHP Code:
<input type="password" size="40" name="wantpassword"/> 
AND

PHP Code:
<input type="password" size="40" name="passagain"/> 
REPLACE WITH:

PHP Code:
<input type="password" size="40" name="wantpassword" id="p1"/> 
PHP Code:
<input type="password" size="40" name="passagain" id="p2"/> 

AFTER DOING THAT WE NEED TO ADD THE BUTTON:

In my case after:

PHP Code:
<input type="password" size="40" name="wantpassword" id="p1"/> 
ADD THIS:

PHP Code:
<input type="button" value="Generate" onclick="randomPass();" /> 
Thats it!

NOTE: If you want to change the password lenght just edit this line where 7 is the number of letters generated:

PHP Code:
pass randomPassword('7'); 
You can also change the characters too in this line:

PHP Code:
chars "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ234567890"
__________________
http://www.bvlist.com/images/avatars/signaturepics/sigpic16443_2.gif
Reply With Quote
The Following 4 Users Say Thank You to Chez For This Useful Post:
EagleLake (28th May 2018), Fynnon (19th May 2018), iforgot (23rd May 2017), Phogo (15th November 2016)
  #2  
Old 30th November 2021, 01:31
BamBam0077 BamBam0077 is offline
Banned
 
Join Date: Jul 2013
P2P
Posts: 410
Wink
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.
Reply With Quote
Reply

Tags
generator , mod , password , random

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 21:12. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.