欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

asp中文数字验证码

程序员文章站 2022-08-06 09:26:13
复制代码 代码如下:
姓 名:
复制代码 代码如下:

<form method="post" name=myform>
姓 名:<input type="text" name="name" value=""><br>
学 号:<input type="text" name="num" value=""><br>
。。。:<input type="text" name="aaa" value=""><br>
。。。:<input type="text" name="bbb" value=""><br>
验证码:<img src="vcode/c.asp" onclick="this.src=this.src" title="点击图片可以更改验证码" height="13" width="52">
<input type="text" size="5" name="c" autocomplete="off" style="ime-mode:disabled;" value="">
<input type="submit" value="提交">
</form>

asp代码:
复制代码 代码如下:

<%
c = request.form("c")
'如果可以输入小写的数字,请把下面三行注释掉
for ii = 0 to 9
c = replace(c,cstr(ii),"")
next
c = replace(c,"零","0")
c = replace(c,"一","1")
c = replace(c,"二","2")
c = replace(c,"三","3")
c = replace(c,"四","4")
c = replace(c,"五","5")
c = replace(c,"六","6")
c = replace(c,"七","7")
c = replace(c,"八","8")
c = replace(c,"九","9")
if cstr(c) <> cstr(session("validatecode")) then
response.write ("验证码不正确")
response.end
end if
%>