Usage:
Insert code where you want to display the picture of the captcha
At the same time, automatically generate session ("PSN"), form to submit validation session on it.
According to the comments of two netizens on the correct use of this verification code there are some questions, here I write a simple example to use:
Press OK:
<%
' Determine if the OK button is pressed, and if pressed, compare the verification code to the correct input
If Request.QueryString ("submit") <> "Then
Dim Checkcode
Checkcode = Trim (Request.QueryString ("Checkcode"))
If Checkcode = Session ("PSN") Then
Response.Write ("<script>alert correct");</script>)
Else
Response.Write ("<script>alert (' Authentication Code error ');</script>")
End If
End If
%>
<form action= "test.asp" method= "Get" >
<input type= "text" name= "Checkcode"/>
<input type= "Submit" name= "Submit" value= "OK" >
</form>
Communicate with the Netizen, discover the Netizen test time, use this:
The result is a different two characters per display, so there is a question! This session ("PSN") gets the session that was last generated. This my ability is limited, also can only according to my understanding to say:
When these two sentences are executed, the execution of the first sentence produces a session ("PSN"), but does it produce faster than the following output session ("PSN")? The answer is no, produce a session you can look at the code inside the Code.asp, so the second sentence of the session to retain the last session. You can try the first time, the second sentence is actually nothing output, and in the example I wrote in the case, there are enough circumstances to change the value of the session. I understand this, if there is something wrong, welcome to enlighten!
File package Download