当前位置:编程学习 > asp >>

动网论坛提取的 验证码

<%
if request("cur_action")="add" then
code=Request.Form("code")
if code=empty then
response.write "<script LANGUAGE='javascript'>alert('请输入验证码!');history.go(-1);</script>"
Session("GetCode")=empty
response.End()
elseif lcase(code)<>lcase(Session("GetCode")) then
response.write "<script LANGUAGE='javascript'>alert('您输入验证码出错!');history.go(-1);</script>"
Session("GetCode")=empty
response.End()
Else
Response.Write "<script>alert('登陆成功');history.back();</script>"        
response.End()
end if
end if
%>
<form name="form" method="post" action="index.asp">
<SCRIPT LANGUAGE=javascript>
/*显示认证码 o start1*/
function get_Code() {
        var Dv_CodeFile = "Dv_GetCode.asp";
        if(document.getElementById("imgid"))
                document.getElementById("imgid").innerHTML = '<img src="'+Dv_CodeFile+'?t='+Math.random()+'" alt="点击刷新验证码" style="cursor:pointer;border:0;vertical-align:middle;height:18px;" onclick="this.src=\''+Dv_CodeFile+'?t=\'+Math.random()" />'
}
/*o end*/
</script>
<script language="JavaScript" type="text/javascript">
var dvajax_request_type = "GET";
</script>
<script language="JavaScript" src="dv_ajax.js" type="text/javascript"></script>
<tr>
  <td style="width:100px; text-align:right">验证码:</td>
  <td style="width:150px; text-align:left"><!--验证码表单-->
    <p>
      <input type="text" name="code" id="code" size="4" maxlength="4" tabindex="6" onfocus="get_Code();this.onfocus=null;" onkeyup="dv_ajaxcheck('checke_dvcode','code');" />
    <span id="imgid" style="color:red">点击获取验证码</span><span id="isok_code"></span></p>
  
   <input name="cur_action" type="hidden" value="add">
   <input name="提交" type="submit" id="提交">
   </td>
</tr>
</form>

补充:asp教程,ASP入门
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,