Web
Expertsforge
Home
FREE Signup
Login
Search
Advertise
Link to Us
Contact Us
Help
Login:
Home
» Categories |
Web Development
»
PHP
» View Tutorial
PHP Tutorial: Generate random password that includes numbers and letters
jawahar
5/2/2005 1:19:01 AM, Views: 4270
The following code illustrates an excellent password generator.
<?php
echo password_gen(6,6);
function password_gen($min=6,$max=6){ /*has a default min value of 6
and maximum value of 6*/
$pwd=""; // to store generated password
for($i=0;$i<rand($min,$max);$i++){
$num=rand(48,122);
if(($num >= 97 && $num <= 122)) $pwd.=chr($num);
else if(($num >= 65 && $num <= 90)) $pwd.=chr($num);
else if(($num >=48 && $num <= 57)) $pwd.=chr($num);
else $i--;
}
return $pwd;
}
?>
Next Steps:
Add this Tutorial to:
Blink
Del.icio.us
Digg
Fark
Furl
Google
Reddit
Simpy
Spurl
Technorati
Win Live
Yahoo
Rate Me!
Avg Visitor Rating:
Number of Ratings : 3 Votes
Rate:
Select Your Rating
Excellent!
Very Good
Good
Fair
Poor
Send Message
Signup
/
Login
To View the Solution or Provide Comments
Post Comment/Solution
Comment:*
(Link Rules)
Use :
[bold] for <b>; [/bold] for </b>; [italic] for <i>; [/italic] for </i>; [code] & [/code] for code
Categories
Applications
Operating Systems
Databases
Programming
Web Development
Networking
Security
Hardware
Search Engine Optimization
Make Money Online
Miscellaneous
Options
Submit a Tutorial
Ask a Question
Add to KB
Join as a Moderator?
Most Popular Tutorial
1.
Finding Google PageR...
2.
Generate random pass...
3.
Uploading files usin...
4.
Creating Cookies usi...
5.
PHP Tool & Free Code...
6.
Displaying Date in t...
7.
Generating Random Nu...
8.
Display contents fro...
9.
Fetching random reco...
10.
Fetching random reco...
Most Popular Solution
No Records!
Top Rated
1.
PHP Tool & Free Code...
2.
Finding Google PageR...
3.
Fetching random reco...
4.
Creating Cookies usi...
5.
Generate random pass...
6.
Generating Random Nu...
7.
Fetching random reco...
8.
Uploading files usin...
Top Rankers
Overall
1. jawahar (500)
Yearly -2008
No Rankings!
Expertsforge Sponsors
1.
Recover deleted files
FREE Signup
Advertise
Link to Us
Contact Us
Sitemap
Tutorial Sitemap
About Us
Privacy Policy
Copyright 2004 - 2008 Expertsforge.com