Add a new anti-spam Comment ASP code, despise garbage _ Application Tips

Source: Internet
Author: User
Recently opened, you can comment on the rubbish has been comments and messages bothered, has not found a good solution. In fact, there are some powerful plug-ins can prevent spam, such as Akismet, but this can only let me remain saliva envy, so recently has been looking for a relatively better solution.

A good way to see it today in bigik.cn is to solve this problem by using user authentication in the form of addition Bigik. The method is reproduced here. Of course, this method is not very perfect, I found that there will be some spam in.

How to use:
Program code
Copy Code code as follows:

Function Getnum ()
Dim Quesionnum
Quesionnum=7 ' The total number of questions, if you want to add a problem, please modify this value first
Dim Codeindex
Codeindex=0

Dim Quesionarray (100)
Dim Answerarray (100)

Quesionarray (0) = "= 1 + 1" ' Problem list and answer, can be modified by oneself
Answerarray (0) = "2"
Quesionarray (1) = "= 2 + 2"
Answerarray (1) = "4"
Quesionarray (2) = "= 3 + 4"
Answerarray (2) = "7"
Quesionarray (3) = "= 2 + 4"
Answerarray (3) = "6"
Quesionarray (4) = "= 1 + 2"
Answerarray (4) = "3"
Quesionarray (5) = "= 2 + 3"
Answerarray (5) = "5"
Quesionarray (6) = "= 4 + 4"
Answerarray (6) = "8"

Randomize
Codeindex = Int ((quesionnum * Rnd) + 0)
Session ("getnum") = Answerarray (Codeindex)
Getnum = "<span style=" "margin-right:40px;" > & Quesionarray (Codeindex) & "</span>"
End Function

Call Method:
Copy Code code as follows:

<%response.write Getnum ()%>

Other modification suggestions:
Problems can be set to subtraction arbitrary questions or other text issues, such as "987 x 654 =?", "How many minorities are there in China?" "And so on, do not let the viewer can not answer it: P.
It is recommended that you change the validation code input box to a smaller width, and the maximum number of input characters set to 2.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.