Adds an ASP code for Anti-Spam comments to despise spam.

Source: Internet
Author: User

I have recently activated this service. I have been plagued by spam comments and have not found a good solution. In fact, WordPress has some powerful plug-ins to prevent spam, such as akismet, but this only makes me envy, so I have been searching for a relatively good solution recently.

Today, we can see a good method on bigik.cn. bigik uses user verification in the form of addition operations to solve this problem. The method is now reproduced. Of course, this method is not perfect. I found that some spam will come in.

Usage:
ProgramCode Copy codeThe Code is as follows: function getnum ()
Dim quesionnum
Quesionnum = 7' total number of problems. To add a problem, modify this value first.
Dim codeindex
Codeindex = 0

Dim quesionarray (100)
Dim answerarray (100)

Quesionarray (0) = "= 1 + 1" 'list of questions and answers, which can be modified by yourself
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 codeThe Code is as follows: <% response. Write getnum () %>

Other modification suggestions:
The question can be set to any question of addition, subtraction, multiplication, division, or other text questions, such as "987x654 = ?" "How many ethnic minorities are there in China ?" Wait, don't let the viewer fail to answer: P.
We recommend that you reduce the width of the verification code input box and set the maximum number of characters 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.