To prevent further attacks, perform a verification code filter.
Program It is necessary. I found some information on the Internet and thought it was done by others.
Code It's always uncomfortable. You don't need to write complicated code, especially for generating images. I tried many methods on the Internet, but I don't know why. Maybe I have no experience. It seems complicated.
It took an hour to write a super simple verification code. Haha is absolutely original and there are only a dozen lines of code. It is generated randomly. Because it is relatively simple, it cannot deal with those powerful posting software, but it is always better than not. After I put the verification code, I observed that I didn't see any spam posts for a few days, it should be effective, haha.
Example:
====== Show. asp ======
Copy code The Code is as follows: <%
Randomize
Randm = int (9000 * RND) + 1000) randomly generates 4-digit code
%>
Verification Code: <input name = YZM id = netadd size = 4 maxlength = "4"> <% = randm %> This is a text box, And the randomly generated function is called next to it.
This js code is used to verify whether the entered verification code is correct.Copy codeThe Code is as follows: <SCRIPT type = text/JavaScript>
Function sendform (OBJ)
{
If (obj. YZM. value! = "<% = Randm %> ")
{
Alert ("Incorrect verification code ");
OBJ. content. Focus ();
Return false;
}
OBJ. Submit ();
Return true;
}
</SCRIPT>
Add this sentence to the OK button.
<Input onclick = sendform (this. form); type = button name = "submit2" value = "add">
The red text must be clear. If it does not match, it cannot run.
Basically, it is so simple. It can be said that it is the core code. In fact, it can be more complicated, but it has not yet been intended to be done. When will it be followed by junk posts.