In order to prevent the attack again, it is necessary to make a verification code filtering procedure. I looked for some information on the Internet, I feel that the code used by others is always very uncomfortable, I do not write a complex code, especially the kind of image generated. Try a lot of methods on the Internet is not good, do not know why, may not experience it. It's kind of complicated.
Finally spent one hours writing a super simple verification code, haha absolutely original, only more than 10 lines of code. Is randomly generated, because relatively simple so can not deal with those powerful posting software, but better than no good, put on the verification code after several days of observation is not to see hair junk post, it should be effective, haha.
Example:
======show.asp======
Copy Code code as follows:
<%
Randomize
Randm=int ((9000*rnd) +1000) randomly generates 4-bit digital code
%>
Verification code: <input name=yzm id=netadd size=4 maxlength= "4" > <%=randm%> this is a text box, and a randomly generated function is called next to it.
This JS code is to verify that the input of the verification code is correct.
Copy Code code as follows:
<script type=text/javascript>
function Sendform (obj)
{
if (obj.yzm.value!= "<%=randm%>")
{
Alert ("Validation code error");
Obj.content.focus ();
return false;
}
Obj.submit ();
return true;
}
</SCRIPT>
Add such a word to the OK button
<input Onclick=sendform (This.form); Type=button name= "Submit2" value= "Add" >
Red text must be seen clearly, if not, it is not run.
Basically is so simple, can be said to be the core code, in fact, can also do more complex, just do not want to do, when there will be spam posts again.