Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Random Password generator.
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Hindi" data-source="post: 251380" data-attributes="member: 26187"><p>Since I was bored and had nothing to do really, I thought I should do something and code something. I ended up coding this simple<em> password generator script.</em></p><p></p><p>Honestly its quite simple nothing complex.</p><p></p><p>So create two files.</p><p></p><p><em>First one : Index.php</em></p><p><em></em></p><p><em>[PHP]<?php</em></p><p><em>include ("init.php");</em></p><p><em>?></em></p><p><em><html></em></p><p><em> <head></em></p><p><em> <title> Random Password Generator </title></em></p><p><em> </head></em></p><p><em> <body> </em></p><p><em> <center></em></p><p><em> </em></p><p><em> <br /></em></p><p><em> <p></em></p><p><em> Your random Password : <?php echo random_string(10); ?></em></p><p><em> </em></p><p><em> <br /><br /><br /></em></p><p><em></em></p><p><em> </p></em></p><p><em> </center></em></p><p><em> </body></em></p><p><em> <footer></em></p><p><em> <center><i> Script written by Hades (Mr H) </i></center></em></p><p><em></html> </em></p><p><em> [/PHP]</em></p><p><em></em></p><p><em>And second file would be : init.php</em></p><p><em>[PHP]<?php</em></p><p><em></em></p><p><em>function random_string($length){</em></p><p><em> $charset = array_merge(range('a','z'), range('A','Z'), range('1','9'));</em></p><p><em> </em></p><p><em> shuffle($charset); // shuffles all characters randomly</em></p><p><em> </em></p><p><em> $password = array_slice($charset, 0, $length);</em></p><p><em> </em></p><p><em> return implode('',$password);</em></p><p><em>}</em></p><p><em></em></p><p><em>?>[/PHP]</em></p><p><em></em></p><p><em>If you edit the <strong>echo random_string(10) </strong>in index.php, It'll change the size of password, like (20) etc. </em></p><p>It uses one function which includes the range of the characters & numbers, shuffles the character set and yeah. enjoy.</p></blockquote><p></p>
[QUOTE="Hindi, post: 251380, member: 26187"] Since I was bored and had nothing to do really, I thought I should do something and code something. I ended up coding this simple[I] password generator script.[/I] Honestly its quite simple nothing complex. So create two files. [I]First one : Index.php [PHP]<?php include ("init.php"); ?> <html> <head> <title> Random Password Generator </title> </head> <body> <center> <br /> <p> Your random Password : <?php echo random_string(10); ?> <br /><br /><br /> </p> </center> </body> <footer> <center><i> Script written by Hades (Mr H) </i></center> </html> [/PHP] And second file would be : init.php [PHP]<?php function random_string($length){ $charset = array_merge(range('a','z'), range('A','Z'), range('1','9')); shuffle($charset); // shuffles all characters randomly $password = array_slice($charset, 0, $length); return implode('',$password); } ?>[/PHP] If you edit the [B]echo random_string(10) [/B]in index.php, It'll change the size of password, like (20) etc. [/I] It uses one function which includes the range of the characters & numbers, shuffles the character set and yeah. enjoy. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Random Password generator.
Top