1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
|
<?
function code_securite($nb,$type) { global $sid; srand(time()); //initialisation du nombre semi aleatoire avec le timestamp if($type == "1" || $type == "2" || $type == "4" || $type == "5"){$choix.="abcdef ghijklmnopqrstuvwxyz";} if($type == "1" || $type == "3" || $type == "4" || $type == "6"){$choix.="ABCDEF GHIJKLMNOPQRSTUVWXYZ";} if($type == "1" || $type == "2" || $type == "3" || $type == "7"){$choix.="012345 6789";} for($i=1;$i<=$nb;$i++) { $indice=rand()%strlen($choix); $sid.=substr($choix,$indice,1); } return $sid; } if(!$type){$type = "1";} if(!$nb){$nb = "8";} ?> <form name="form1" method="post" action=""> <h1><b>Création automatique d'un mot de passe.</b></h1> <p><b><u><font size="3">étape 1 :</font><br> </u></b><u> Sélectionnez la constitution de votre mot de passe.</u><br>
<input name="type" type="radio" value="1" <? if(!$type || $type == "1"){echo "ch ecked";}?>> chiffre / lettre / LETTRE<br>
<input type="radio" name="type" value="2" <? if($type == "2"){echo "checked";}?> > chiffre / lettre<br>
<input type="radio" name="type" value="3" <? if($type == "3"){echo "checked";}?> > chiffre / LETTRE<br>
<input type="radio" name="type" value="4" <? if($type == "4"){echo "checked";}?> > lettre / LETTRE <br>
<input type="radio" name="type" value="5" <? if($type == "5"){echo "checked";}?> > lettre<br>
<input type="radio" name="type" value="6" <? if($type == "6"){echo "checked";}?> > LETTRE <br> <input type="radio" name="type" value="7" <? if($type == "7"){echo "checked";}?> > chiffre</p> <p class="texte"><b><u><font size="3">étape 2 :</font></b></u><br>
<u>nombre de caractère du mot de passe :</u>
<select name="nb" id="nb"> <option value="4" <? if($nb == "4"){echo "selected";}?>>4</option> <option value="6" <? if($nb == "6"){echo "selected";}?>>6</option> <option value="8" <? if(!$nb || $nb == "8"){echo "selected";}?>>8</option> <option value="10" <? if($nb == "10"){echo "selected";}?>>10</option> <option value="15" <? if($nb == "15"){echo "selected";}?>>15</option> <option value="20" <? if($nb == "20"){echo "selected";}?>>20</option> </select><br>
<input name="go" type="submit" id="go" value="Création du mot de passe"> </p> </form>
<? if($go){?> <b><u><font size="3">étape 3 :</font></u></b><br> Faites un copier / coller du mot de passe généré dans le ca dre orange.<br>
</span> <table width="330" border="1" align="center" cellpadding="0" cellspacing="0" bor dercolor="#FF9900"> <tr> <td width="326" height="38" align="center" valign="middle"> <font size="5"><? echo code_securite($nb,$type);?></font> </td> </tr> </table> <? }?> |