WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
PHP Web Logs (BLogs)
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Submit Site
Forex Trading Online forex trading platform

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : complete simply working javascript password generator file. Use letter, vowels, consonants (uppercase and lowercase) arrays to create a really random and secure password. improved security using time functions to initialize random number generator.
Categories : Java Script, HTML, Security, Authentication, Strings Update Picture
Aureliano Rama
Date : Jun 12th 2002
Grade : 2 of 5 (graded 4 times)
Viewed : 14519
File : jspassgen.html
Images : No Images for this code example.
Search : More code by Aureliano Rama
Action : Grade This Code Example
Tools : My Examples List

  Submit your own code examples 
 

<html>
<head>
<title>JSPassGen v2.1</b></title>

<script language="javascript">
<!-- //hide

// JSPassGen v2.1
// Javascript password generator
// by Ummon <jeffhawke@iname.com>
// heavily based on Jpass v1.1 (Kelv 2000 kelv@kelv.net)
// http://freshmeat.net/projects/jpass/

/*
        complete simply working javascript password generator file. Use letter,
vowels, consonants
(uppercase and lowercase) arrays to create a really random and secure password.
        improved security using time functions to initialize random number generator.
        can be embedded in html and can be used in HTML event handler like onclick
and onmouseover.
        tested in Explorer, Netscape and Mozilla enviroment.

        This little script uses some arrays of consonants, vowels and digits to
create a really random
password
        As javascript doesn't have a reliable random function, it use more layers of
randomizers than
normally required for such a script.

*/

function choice(arg)
//return random index number in valid range of arg array
{
        return Math.floor(Math.random()*arg.length);
}

function randstr(arg)
//return random argument of arg array
{
var str = '';
var seed = choice(arg);
        str = arg[seed];
return str;
}

function initialize()
//use actual time to initialize random function as javascript doesn't provide an
initialization function itself
//to get more random, use getMilliseconds() function
//don't use getTime() as it produces numbers larger than 1000 billions, eheh
{
        var count=new Date().getSeconds();
        for (c=0; c<count; c++)
                Math.random();
}

function mkpass()
{
        //use of initialize() can decrease speed of script. On really slow systems,
disable it.
        initialize();

        //password length
        var pass_len=10;

        var cons_lo =
['b','c','d','f','g','h','j','k','l','m','n','p','q','r','s','t','v','w','x','y','z']
;
        var cons_up =
['B','C','D','F','G','H','J','K','L','M','N','P','Q','R','S','T','V','W','X','Y','Z']
;
        var hard_cons_lo = ['b','c','d','f','g','h','k','m','p','s','t','v','z'];
        var hard_cons_up = ['B','C','D','F','G','H','K','M','P','S','T','V','Z'];
var link_cons_lo = ['h','l','r'];
var link_cons_up = ['H','L','R'];
var vowels_lo = ['a','e','i','o','u'];
var vowels_up = ['A','E','I','U']; //O (letter o) and 0 (number zero) get
confused
        var digits = ['1','2','3','4','5','6','7','8','9'];

        //change at will how many times digits appears in names array. Order doesn't
matter
        var names = [cons_lo, cons_up, digits, hard_cons_lo, hard_cons_up, digits,
link_cons_lo,
link_cons_up, digits, vowels_lo, vowels_up, digits];

var newpass= '';
        for(i=0; i<pass_len; i++)
         newpass = newpass + randstr(names[choice(names)]);

return newpass;
}

// -->
</script>

</head>
<body bgcolor=#ffffff>

<center>
<b>JSPassGen v2.1</b><br>
(c) 2002 <a href="mailto:jeffhawke@iname.com">Ummon</a>
<br><br>

Onclick event on button:<br>
<form name="pswd">
<input type="text" name="pass" size="15">
<input type="button" value="Generate" onclick="document.pswd.pass.value=mkpass()">
</form>

Onclick event on link:<br>
<form name="pswd2">
<input type="text" name="pass" size="15">
<a href="javascript:void(0)" onclick="document.pswd2.pass.value=mkpass
()">Generate</a>
</form>

</center>


</body>
</html>



MD5 secured login
Categories : PHP, Java Script, Authentication, Security
Prevent Right Mouse steal your graphics
Categories : HTML, Java Script, Security
Password using php, Javascript, and html form
Categories : Security, PHP, Authentication, Java Script
Allows you to parse a deliniated string and put the individual fields in a SELECT option in a form
Categories : HTML, PHP, Strings
Clock at Status Bar
Categories : Java Script, HTML, Date Time
Simple Password example
Categories : PHP, Authentication, Security, HTTP
PHP Function to Encrypt/Decrypt a string without a known key. The string itself has his own different key for every character.
Categories : PHP, Algorithms, Security, Authentication, Encryption
Unobtrusive javascript for maintaining scrollable layer state
Categories : DHTML, Java Script, HTML
Java Script Based Navigation
Categories : HTML, Java Script, Navigation
Enchancing dd/mm/yyyy forms with unobtrusive javascript
Categories : Java Script, HTML, User Interface, Date Time
Builds JavaScript that updates the contents of one selector based on another.
Categories : HTML, Java Script, PHP, Complete Programs, General
Bypassing Plugin / FLASH Activation
Categories : Java Script, Web Browsers, Security, Flash
A damaged image generator (class) for validating text. CAPTCHA - Completely Automated Public Turing test to tell Computers and Humans Apart
Categories : PHP, PHP Classes, Security, GD image library, Security
Redirect users that arrive on your site from a link out side your domain.
Categories : Java Script, Strings
Why it is not possible to preset a value in a file upload field
Categories : HTML, Security, Filesystem, Beginner Guides