More effective methods for anti-malicious advertisements on the Internet with ASP code

Source: Internet
Author: User

1.
After entering the background, the overall management of the style template, page_login,template.html (13)

<Tr>
<TD class = tablebody1> <B> password problem </B>: <br> A prompt for the password is missing </TD>

Add the followingCode

<Tr>
<TD class = tablebody1>
<Div style = "color: Red"> <B> required for anti-Forum Group Sending: </B> </div>
<Div> to prevent malicious registration of mass software, </div>
<Div> please answer the following questions </div>
<Div style = "color: Blue; font-size = 18px"> <B >{$ evilquesion} <B> </div>

</TD>
<TD class = tablebody1> <input size = 30 name = evilanswer> </TD>
</Tr>

2. Open Reg. asp and find
<! -- # Include file = "INC/md5.asp" -->
Add
<! -- # Include file = "INC/checkedevil. asp" -->
Find
Templatestr = Replace (templatestr, "{$ user_belief}", selectinfo (5 ))
Add
Randomize
Session ("evilid") = int (RND * quesionnum)
Templatestr = Replace (templatestr, "{$ evilquesion}", quesionarray (Session ("evilid ")))
Find
Else
Quesion = request. Form ("quesion ")
End if
Add
If request. Form ("evilanswer") = "" then
Errcodes = errcodes + "<li>" + "Please fill in anti-malicious registration problems! "
End if

If not checkedevil (request. Form ("evilanswer") then
Errcodes = errcodes + "<li>" + "An error occurred while preventing malicious registration. Please return and try again. "
End if

3. Add a new file checkedevil. asp, fill in the following code, and upload it to the Forum Inc directory, that is,/INC/checkedevil. asp.
<%
Dim quesionarray (100)
Dim answerarray (100)
Dim quesionnum
Quesionnum = 5' Please set the total number of problems here

Function checkedevil (answer)
Dim trueanswer
If SESSION ("evilid") = "" then
Checkedevil = false
Exit Function
End if
Trueanswer = CSTR (answerarray (Session ("evilid ")))
If answer = trueanswer then
Checkedevil = true
End if

End Function

Quesionarray (0) = "what is the square of 12? (Number )"
Answerarray (0) = "144"
Quesionarray (1) = "what is the name of the longest river in China? "
Answerarray (1) = "Yangtze River"
Quesionarray (2) = "what is the next sentence of" looking at the moon with your head? (Tip: bow down ?? Country )"
Answerarray (2) = "My Hometown"
Quesionarray (3) = "what is the next sentence of" looking at the moon with your head? (Tip: bow down ?? Country )"
Answerarray (3) = "My Hometown"
Quesionarray (4) = "who is the only queen in Chinese history? (Tip: Wu? Day )"
Answerarray (4) = "Wu Zetian"

%>

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.