我想在我的 php 表单中添加一个简单的数学验证码,,,
这是完整的表单代码,但它不起作用。
这是代码的链接:http: //thefairygodsister.com/testtest/index%20-%20Copy.txt
我想在我的 php 表单中添加一个简单的数学验证码,,,
这是完整的表单代码,但它不起作用。
这是代码的链接:http: //thefairygodsister.com/testtest/index%20-%20Copy.txt
You can also make a "faux" maths captcha like here that works on the very simple principal that the text needed to be inputted is fixed and indicated in an image - works perfectly at stopping bots sending you random emails without over complicating it.
采取的基本步骤是:假设这是一个加 2 个数字的数学
$num1 = rand(15,50);
$num2 = rand(2,9);
$salted_answer = $num1+num2 + 187; //thats some salt
将 salted_answer 放入表单上的隐藏输入中。
检查时:
if ($_POST['salted_answer'] - 187 == $_POST['answer']) {
echo "all is good";
// do your processing
}
而已。