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 password generator script.
Honestly its quite simple nothing complex.
So create two files.
First one : Index.php
And second file would be : init.php
If you edit the echo random_string(10) in index.php, It'll change the size of password, like (20) etc.
It uses one function which includes the range of the characters & numbers, shuffles the character set and yeah. enjoy.
Honestly its quite simple nothing complex.
So create two files.
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>
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);
}
?>
If you edit the echo random_string(10) in index.php, It'll change the size of password, like (20) etc.
It uses one function which includes the range of the characters & numbers, shuffles the character set and yeah. enjoy.