Easy to remember password for the membership tutorials
Author : Logarkh
This code will create an easy to remember random password. This code replaces the current randompassword() functions in the membership tutorial.
You MUST create a file named pw_words.txt, in this file you put in four letter words from the dictionary seperated by a space, it is advisable to put in as many four letter words that you can find.
Once you have done this the function will randomly select one of the words you have entered into the file and then add four random numbers to the end of it. An example of what the code produces is feet6283
PHP Example :
<?
function RandomPassword()
{
$words = "pw_words.txt";
$cut_off = 4;
$fp = fopen($words, "r");
if(!$fp)
{
echo '<font color="red"><b>[ERROR]: Could not load password array</font></b>';
exit();
}