实现验证码的功能,并且能够在不刷新整个页面的情况下刷新验证:
控件库有三个文件(源文件),点击本页面右边可以下载到。
具体调用
添加显示验证码和输入框
在需要添加验证码的页面中添加如下代码:
<input name='validatecode' type='text' size='5'> <img src='valuechk/validatecode.asp' align='absmiddle' border='0' onClick="this.src='valuechk/validatecode.asp'" style="cursor:hand" title="单击刷新验证码">
记录接受页面处理
处理页中添加如下代码:
if Trim(Request.Form("validatecode"))=Empty Or Trim(Session("cn_web.com_ValidateCode"))<>Trim(Request.Form("validatecode")) then
response.write"<script>alert('验证码有误!');location.href='fabu.asp'</script>"
response.end
end if




Asp技术教程





附件下载
☆