我有一个简单的垃圾邮件过滤器(防止垃圾邮件提交),通过生成随机号码和用户进入网站。 由于某种原因,垃圾邮件仍然能够进入,甚至连随机进入。 是否有人想如何做到这一点?
该法典:
var randomnumber=Math.floor(Math.random()*1001);
var isNumberEnteredCorrect = false;
var whatevertheyentered;
function checkUserInput(whatevertheyentered){
if(whatevertheyentered == randomnumber){
return true;
}
else {
return false;
}
}
function validateForm()
{
var x = document.forms["myForm"]["random_number"].value;
if(x == randomnumber){
return true;
}
else{
alert("The number you ve entered is incorrect.");
return false;
}
}
用户提出表格,要求这一纽扣:
<input name="Submit" type="submit" class="button" value="Send Message" />