Mammouth du PHP |
558 Messages
13 nov. 2007, 00:25
ou alors quelque chose comme cela.
<table width="256">
<tr>
<td width="256"><div align="center"><span style="color: #000000"><span class="Style10">code de verifcation :<br>
combien font <br>
<?php
$rand=rand(0,5);
$rand1=rand(0,5);
$codeverif1=$rand+$rand1;
$i=rand(0,25);
$alpha=array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');
$rand2=$alpha[$i];
$codeverif2="$codeverif1$rand2";
$codeverif=md5("$codeverif2");
echo"".$rand." plus ".$rand1." ajoutez lui la lettre ".$rand2." à la fin sans espace"; ?>
</span></span></div></td></tr><tr>
<td width="256"><div align="center"><span style="color: #000000">
<input name="codeverif" type="text" class="Style10" id="codeverif" size="15">
<input name="codeverif1" type="hidden" class="Style10" id="codeverif1" value="<?php echo"".$codeverif.""; ?>">
et en recuperation
<?php
$codeverif2 = htmlentities($_POST['codeverif']);
$codeverif = md5("$codeverif2");
$codeverif1 = htmlentities($_POST['codeverif1']);
if($codeverif != $codeverif1)
{
$reponse = "Le code de securité n'est pas correct";
echo"<SCRIPT LANGUAGE=\"JavaScript\">
document.location.href=\"connection.php\"</SCRIPT>";
exit();
}
?>
quelque chose me dit que l'on peu encore amelioré se point mais je n'arrive pas a trouvé .