WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
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 Resources
Web Development Content
Internet Security Software
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
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

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 : Passgen: Automatically generate mixed case alpha numeric passwords
Categories : PHP, Security Update Picture
Simon Booth
Date : May 23rd 2000
Grade : 3 of 5 (graded 2 times)
Viewed : 9444
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Simon Booth
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

<script language="php">

function passgen($len)
{
$pass = "";

if($len > 5 && $len < 17)
{
srand((double) microtime() * 1000000);
for($i=0;$i<12;$i++)
{
$pass .= chr(rand(0,255));
}
$pass = substr(base64_encode($pass), 0, $len);
}
return $pass;
}

</script>

<!--
Function passgen (above) creates a random password suitable for any use. The
generated passwords are pure junk - using mixed alpha, numeric and a few symbols.

Usage:

passgen(int password_length);

Password length can be anything from 6 to 16 characters. Other length values
result in an empty string being returned.

Method:

Quite simple. A string of 12 random 8 bit characters is built up in a loop. The
resulting random 12 bytes of data are then UU-Encoded which provides a 16
character string of mixed case, numerics and a few symbols. This is then
shortened to the length requested in the parameter passed to passgen to return
a random password of the requires length.

Example usage below (you can just chuck this on a server to see what it does).
Strip out the function above to use it in your own code.
-->

<html>
<head>
<title>Password Generator</title>
</head>
<body bgcolor="#FFFFFF">

<p>
<font face="Arial" size="4">
Password generator example
</font>
</p>

<pre>
<script language="php">
for($i=0;$i<8;$i++)
{
echo passgen(8)."<br>";
}
</script>
</pre>

</body>
</html>



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
Function to generate readable/remeberable random password
Categories : PHP, Security, Security
IPTables Bandwidth statics
Categories : PHP, Security, Network
Random Password Generator
Categories : PHP, Strings, Security
A very simple PHP single password cookie based login without usernames.
Categories : PHP, Cookies, Security, Beginner Guides
Generating and Matching Secure and Strong Password Hash
Categories : PHP, PHP Classes, Cryptography, Security
PHP Cookies - Simple cookie write/read methods that allow basic encryption
Categories : PHP, Cookies, Security, Encryption
phpSecurePages is a PHP module to secures pages with a loginname and password. It handles multiple user groups (each has own viewing rights), store data in a MySQL database or a configuration file, and can be used to identify Web site viewers.
Categories : PHP, Security, Authentication
A login page that require username, password and userlevel.
Categories : PHP, Security, Sessions, MySQL, Databases
Authenticator for Exchange Server LDAP
Categories : PHP, Authentication, LDAP, Security, Sessions
Password Creator: This PHP code exmaple shows how to use bitwise operations on a single variable and using it as a flagged variable. The class generates passwords of a given length using specified characters and the flags.
Categories : PHP, PHP Classes, Algorithms, Security
Use of bitmasks to represent permissions
Categories : PHP, Authentication, Bitwise Operators, Security, PHP Classes
SHA: Implementation of the Secure Hash Algorithm in pure PHP. This is a secure one-way function that can be used to perform challenge response login algorithms over an insecure connection.
Categories : Algorithms, PHP, Security
Easily Grant Temporary SSH Access to yourself when in remote location
Categories : PHP, Linux, Cron, Security
Simple Password example
Categories : PHP, Authentication, Security, HTTP
 Zaid Crowe wrote :1258
ive been scouring the net for a good simple alphnumeric random string generator ......and this one rocks!