Remove old code
This commit is contained in:
@ -23,36 +23,6 @@ function getimage() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Captcha (cf http://www.webelix.net/trucs_et_astuces-(PHP)_Anti_Robots_Spammeurs.html)
|
|
||||||
|
|
||||||
function aff_captcha()
|
|
||||||
{
|
|
||||||
// Tableau de valeurs
|
|
||||||
$input = array(2, 35, 15, 6, 40, 4, 8, 22, 11, 5, 32, 10, 1, 12, 26, 16, 55, 17);
|
|
||||||
// Extraction al<61>atoire de deux valeurs du tableau
|
|
||||||
$rand_keys = array_rand($input, 2);
|
|
||||||
// Creation et calcul de la somme des deux valeurs
|
|
||||||
$question = 'Quelle est la somme de <strong>'.$input[$rand_keys[0]].' + '.$input[$rand_keys[1]].' = </strong>';
|
|
||||||
$add = md5($input[$rand_keys[0]] + $input[$rand_keys[1]]);
|
|
||||||
|
|
||||||
echo '<table cellspacing="0" cellpadding="6" style="border: 1px solid red">
|
|
||||||
<tr>
|
|
||||||
<td><strong>Anti-Spam : </strong>'. $question .'</td>
|
|
||||||
<td><input name="reponse" type="text" size="3" maxlength="3" value="" style="font-weight: bold" />
|
|
||||||
<input name="captcha" type="hidden" value="'. $add .'" /></td>
|
|
||||||
</tr>
|
|
||||||
</table>';
|
|
||||||
}
|
|
||||||
|
|
||||||
function valid_captcha()
|
|
||||||
{
|
|
||||||
// if (md5($_POST['reponse']) == $_POST['captcha'])
|
|
||||||
if (md5(get_post('reponse')) == get_post('captcha'))
|
|
||||||
return true;
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// escape_string
|
// escape_string
|
||||||
// Action: Escape a string
|
// Action: Escape a string
|
||||||
|
|||||||
Reference in New Issue
Block a user