T4VN is an online PHP Help community that provides PHP Tutorials, PHP Examples, PHP Scripts, PHP Support
    HOME  |  HOSTING COUPON  |  TEMPLATE  |  PHP SCRIPTS  |  LINK TO US  |  LINK  |  REGISTER | CONTACT
::: Member Login :::
 Username
 Password
 
Forgot your password ?
::: PHP Tutotal :::
  PHP Basic (7)
  PHP Advanced (4)
  PHP Database (2)
  Coding Step By Step (8)
  PHP and AJAX (0)
::: PHP Example :::
  Arrays (1)
  Code Highlighters (3)
  Database Functions (12)
  Date & Time (5)
  E-Mail (6)
  Forms (5)
  Guestbooks (1)
  Logging (2)
  Miscellaneous (10)
  Password Generators (3)
  Randomizers (3)
  String Manipulation (10)
  User Authentication (6)
::: Search On T4VN :::
::: T4VN Statistics :::
  PHP Scripts : 50
  PHP Example : 67
  PHP Tutorials : 21
  PHP News : 93
  Total Coupon : 36
  Other Tutorials :
  Member : 172
  Visitor Online : 2
  Today Visit: 118
  Total Visitor : 99744
  Most Online : 25
::: Sponsored Links :::

PR 4 For This Webpage
Home Today :

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(); 
   } 

   while(!
feof($fp)) 
   { 
      
$tword trim(fgets($fp,6)); 
      if(
strlen($tword) >= $cut_off
      { 
         
$word[] = strtolower($tword); 
      } 
   } 
   
fclose($fp); 

   
$size_word count($word); 
   
$pass .= $word[rand(0,($size_word 1))]; 

   
srand((double)microtime()*1000000); 
   
$count 0
   while (
$count <= 3
   { 
      
$tmp rand(09); 
      
$pass $pass .= $tmp
      
$count++; 
   } 
   return 
$pass

}
?>


Other Example


::: Resources :::
  Links Directory
  Programming 2 3
  Webmaster 2 3
  Web Design 2 3
  Web Hosting 2 3
  Other Links 2 3
  Asian ShowBiz News
  Teach Seo For You
::: New Templates :::




::: Other Tutorials :::
 Program Design

  Powered By T4VN.NET - Version 2.0 - CopyRight © T4VN.NET 2005-2007