Home
Links
 
 
Home Page What is the Web 2.0 Web as a platform Netscape vs. Google DoubleClick vs. Overture and AdSense Akamai vs. BitTorrent Protection of web-services against a spam Server inclusions SSI (a part 1) Realiti Show of Creation of the Website Generation of the casual password What see search engines at call on a site? Visit cajt WebPosition Gold Construction of a site Contextual advertising. Modular structure of page Reception of heading of the removed page The script and processing of events in JavaScript Processing of the events connected to windows, in language javascript Concepts, terms and bases Java-skriptovanija
 

Generation of the casual password

This lesson will show you how to make generation of the casual password with help PHP. The following code includes also check on minimal and a maximum quantity of symbols. So …



<? php


$min=4; // a minimum quantity of symbols

$max=15; // a maximum quantity of symbols


$pwd = "";


for ($i=0; $i <rand ($min, $max); $i ++)


// Loading and check of symbols


{

$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 if ($num == 95)

{

$pwd. = chr ($num);

}


else

{

$i-;

}

}


echo $pwd; // a conclusion of the password

?>