| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 792 人关注过本帖
标题:asp验证码
只看楼主 加入收藏
qq258457
Rank: 1
等 级:新手上路
帖 子:25
专家分:0
注 册:2013-4-21
结帖率:80%
收藏
 问题点数:0 回复次数:2 
asp验证码
请问谁有asp的验证码文件包能发上来吗         我没分数了 不能给了
搜索更多相关主题的帖子: asp 验证码 
2013-04-25 04:59
qq258457
Rank: 1
等 级:新手上路
帖 子:25
专家分:0
注 册:2013-4-21
收藏
得分:0 
我在网上下载了个验证码文件包,也套入到我的asp界面了
图片附件: 游客没有浏览图片的权限,请 登录注册
在网页中也能显示
图片附件: 游客没有浏览图片的权限,请 登录注册
但是不知道怎么写判断语句,那个验证码文件包包里有这样一个语句<%
startime=timer()
'以下为常用过程
public sub GetCode()
response.write "<img src=""imgchk/validatecode.asp"" alt= ""验证码,看不清楚?请点击刷新验证码"" style=""cursor : pointer;height : 14px;"" onclick=""this.src='imgchk/validatecode.asp'""/> "
end sub
public sub CodeIsTrue(b)
if CStr(Session("GetCode"))<>cstr(Trim(Request("Code"))) then
randomize
Session("GetCode")=rnd()
if b="" then
response.write "<script language=JavaScript>" & chr(13) & "alert('验证码错误,请刷新页面后重新输入!');" & "history.back()" & "</script>"
else
response.write "<script language=JavaScript>" & chr(13) & "alert('验证码错误,请重新输入!');"&"window.location.href = '"&b&"'"&" </script>"
end if
Response.End
end if
end sub
%>
是用来套进去的吗,高手能不能说下怎么套
这是我网页中代码,请问下如果是套进去那套在上面地方还要不要修改<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../Connections/conn.asp" -->
<%
' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables("URL")
If Request.QueryString <> "" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request.QueryString)
MM_valUsername = CStr(Request.Form("p"))
If MM_valUsername <> "" Then
  Dim MM_fldUserAuthorization
  Dim MM_redirectLoginSuccess
  Dim MM_redirectLoginFailed
  Dim MM_loginSQL
  Dim MM_rsUser
  Dim MM_rsUser_cmd
  
  MM_fldUserAuthorization = ""
  MM_redirectLoginSuccess = "index.asp"
  MM_redirectLoginFailed = "cuowu.asp"

  MM_loginSQL = "SELECT xm, mm"
  If MM_fldUserAuthorization <> "" Then MM_loginSQL = MM_loginSQL & "," & MM_fldUserAuthorization
  MM_loginSQL = MM_loginSQL & " FROM dbo.web_biao WHERE xm = ? AND mm = ?"
  Set MM_rsUser_cmd = Server.CreateObject (")
  MM_rsUser_cmd.ActiveConnection = MM_conn_STRING
  MM_rsUser_ = MM_loginSQL
  MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param1", 200, 1, 50, MM_valUsername) ' adVarChar
  MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param2", 200, 1, 50, Request.Form("u")) ' adVarChar
  MM_rsUser_cmd.Prepared = true
  Set MM_rsUser = MM_rsUser_cmd.Execute

  If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
    ' username and password match - this is a valid user
    Session("MM_Username") = MM_valUsername
    If (MM_fldUserAuthorization <> "") Then
      Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)
    Else
      Session("MM_UserAuthorization") = ""
    End If
    if CStr(Request.QueryString("accessdenied")) <> "" And false Then
      MM_redirectLoginSuccess = Request.QueryString("accessdenied")
    End If
    MM_rsUser.Close
    Response.Redirect(MM_redirectLoginSuccess)
  End If
  MM_rsUser.Close
  Response.Redirect(MM_redirectLoginFailed)
End If
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
<!--
.l {
    color: #FFF;
}
.l {
    color: #FFF;
}
body {
    background-color: #069;
    font-size: 24px;
    color: #FFF;
}
.a {
    font-size: 24px;
}
.a {
    font-size: 24px;
    color: #FFF;
}
o {
    color: #000;
}
#form1 table tr td {
    color: #000;
}
.l {
    font-size: 12px;
}
.l {
    font-size: 16px;
}
-->
</style>
<script type="text/javascript">
<!--
function MM_validateForm() { //v4.0
  if (document.getElementById){
    var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
    for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
      if (val) { nm=val.name; if ((val=val.value)!="") {
        if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
          if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
        } else if (test!='R') { num = parseFloat(val);
          if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
          if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
            min=test.substring(8,p); max=test.substring(p+1);
            if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
      } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
    } if (errors) alert('请输入完整的用户名和密码'+);
    document.MM_returnValue = (errors == '');
} }
//-->
</script>
</head>

<body>
<table width="95%" height="121">
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
<table width="50%" height="293" border="0" align="center">
  <tr>
    <td width="33%" height="54" align="center" bgcolor="#0033CC"><h2 class="l">刘学东专有界面</h2></td>
    <td width="67%" align="center" bgcolor="#0033CC"><h2 class="l">欢迎登陆后台管理界面</h2></td>
  </tr>
  <tr>
    <td height="209" bgcolor="#DCE5EE"><img src="../images/7969514_142748924002_2-恢复的_18.gif" width="20" height="84" /><img src="../images/7969514_142748924002_2-恢复的_10.gif" width="144" height="207" /></td>
    <td valign="top" bgcolor="#D9E3EC"><form id="form1" name="form1" method="POST" action="<%=MM_LoginAction%>">
      <table width="100%" height="176" align="center">
        <tr>
          <td align="right">用户名:</td>
          <td align="left"><input type="text" name="p" id="p" /></td>
        </tr>
        <tr>
          <td align="right">密码:</td>
          <td align="left" onfocus="MM_validateForm('p','','R','u','','R');return document.MM_returnValue"><input name="u" type="password" id="u" value="" /></td>
        </tr>
        <tr>
          <td align="right">验证码:</td>
          <td><input name="textfield" type="text" id="textfield" size="6" />
          <input type="image" name="imageField" id="imageField" src="../cc/验证码/imgchk/validatecode.asp" />
          </td>
        </tr>
        <tr>
          <td align="right">&nbsp;</td>
          <td><input type="submit" name="button" id="button" value="登陆后台" />
<input type="reset" name="button2" id="button2" value="从新输入" /></td>
        </tr>
      </table>
    </form></td>
  </tr>
  <tr>
    <td colspan="2" align="center"><hr />
    <marquee>版权&copy;刘学东保留所有版权</td>
  </tr>
</table>
</body>
</html>
2013-04-25 12:42
dcwl
Rank: 1
来 自:江西省赣州市
等 级:新手上路
帖 子:2
专家分:0
注 册:2013-12-20
收藏
得分:0 
看看
2013-12-20 08:25
快速回复:asp验证码
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017144 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved