ASP Chinese Image Verification Code _ application skills

Source: Internet
Author: User
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:

<%=session ("PSN")%>

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:

<%=session ("PSN")%>

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
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.