Resolution | Verification Code | Code 1, download file
Imgchk.rar:http://www.blueidea.com/articleimg/2005/08/2671/imgchk.rar
The compressed package is a Imgchk folder with three files: Validatecode.asp,validatebody.fix,validatehead.fix
The main is to generate the authentication Code service.
Release the unzipped folder directly in the same directory where you need to add a captcha to a page (for example, addnew.asp needs to add a CAPTCHA, which is under the Cnbruce folder, the Imgchk folder is released to the Cnbruce folder at the same time)
2, add display verification code and input box
Add the following code to the page where you want to add the authentication code:
<input name= ' validatecode ' type= ' text ' size= ' 5 ' >
3. Record Accept page Processing
In step 2, you must submit the records to a page, and then add the following code to the processing page:
If Trim (Request.Form ("Validatecode")) =empty Or Trim (Session ("Cnbruce.com_validatecode")) <>trim (Request.Form ("Validatecode")) Then
Response.Write ("Please note the correct input of the verification Code")
Response.End
End If
Verification Code principle:
When you generate a CAPTCHA picture, a session is generated with the value of the numeric value in the Captcha picture.
At the same time, provide input box for user input, submit input value, compared with the existing session value, according to the judgment result make corresponding judgment.
If you need to modify the name of the session, only two places are changed:
A: You download the Imgchk folder in the validatecode.asp, which involves the cnbruce.com to your;
B: Just step 3 of the Trim (session ("Cnbruce.com_validatecode")) <>trim (Request.Form ("Validatecode")) The cnbruce.com in is changed to a set.
In addition ===================================================
Show the check code patch (some friends show no verification code, here to see)
Create a file Sp2.reg with the following content (Notepad, save As)
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Security]
"BLOCKXBM" =dword:00000000
Double-click the Import registry, and then restart the machine.