Many webmaster for the forum is too many spam ads crazy, this procedure is to deal with the forum spam mass device.
Change the verification code to an addition operation, such as the verification code display "25+64 equals?" , then enter "91" to pass validation.
Look at the effect chart contrast: Character verification Code: → Addition Verification Code:
Advantages:
① compared with the pure character verification Code, this program effect prevents the majority of (more than 99%) advertising machine automatic recognition. Even the Chinese verification code can be identified by some of the advertising machines in the market.
Compared with Chinese verification code, ② avoids the trouble of switching input method when users enter user name password verification code.
Interested friends can also be extended to other operations, such as multiplication, subtraction, exponentiation, and so on.
How to: Save the following code as a dv_getcode.asp file, replacing the Web forum's file. background colors, font colors can be modified in your code.
Description: This program requires web space to support AspJpeg components, italics _gb2312 fonts.
I will post a version that does not require the support of components and fonts, and interested people please pay attention to my blog.
<% ' ============================================================================= ' Dynamic Network Forum addition verification Code (AspJpeg version) ' Author: cuixiping ' blog (CSDN): http://blog.csdn.net/cuixiping/' blog (blog Park): http://www.cnblogs.com/cuixiping/' Date: November 2008 ' Generate 100x20 JPEG image verification code, content similar to "25+64 equals?"
"' requires web space support for AspJpeg components (PERSITS.JPEG).
' If the server does not have a ' italic _gb2312 ' font, modify it to another font and adjust the character position.
' Usage: Replace this code with the contents of the dv_getcode.asp file of the dynamic Network forum, and do not leave the file blank.
' ============================================================================= Const FontColor = &H000000 ' Font color Const bgcolor = &HFFCCFF ' background color call Creatvalidcode ("GetCode") Sub Creatvalidcode (PSN) Dim x, Jpeg Randomize x = Array (1+int (Rnd () *9), int (Rnd () *10), 1+int (Rnd () *9), int (Rnd () *10), 0, 0, "+") x (4) = x (0) *10 + x (1) x (5) = x (2) *10 + X (3) ' session (PSN) = CStr (Eval (x (4) & X (6) & X (5)) "session (PSN) = CStr (x (4) + x (5)) Set Jpeg = Server.crea Teobject ("Persits.jpeg") jpeg.new 100,20,bgcolor jpeg.quality=100 with Jpeg.canvas. Font.Bold = True. Font.Size = 16. Font.rotation = 0. font.family = "Italics _gb2312". Font.Color = FontColor. Printtext 4, 3, CSTR (x (0)). Printtext 3, CSTR (x (1)). Printtext, 3, X (6). Printtext, 3, CStr (x (2)). Printtext 3, CStr (x (3)). Font.rotation = 15. Printtext 55, 3, "et". Printtext 70, 3, "on". Printtext 85, 3, "? "End with" Disables caching Response.ContentType = "Image/jpeg" Response.Expires = -9999 response.addheader "Pragma", "no-c Ache "Response.AddHeader", "Cache-ctrol", "No-cache" Response.AddHeader "content-disposition", "inline"; Filename=vcode.jpg "Jpeg.sendbinary jpeg.close Set Jpeg = Nothing End Sub%>