| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1614 人关注过本帖
标题:ASP链接数据库问题!!!
只看楼主 加入收藏
无忧当当
Rank: 1
等 级:新手上路
帖 子:40
专家分:0
注 册:2008-7-9
结帖率:100%
收藏
 问题点数:0 回复次数:11 
ASP链接数据库问题!!!
问题阐述:
我用DREAMWEAVER CS3做了一个网站登入界面,测试时,我先故意输入一个错误的密码,调试成功转入登入错误界面,通过登入错误界面上的链接返回登入界面后,输入正确的姓名和口令后却出现“无法显示网页”!详细情况:
无法显示网页
试图访问的网页出现问题,无法显示。

--------------------------------------------------------------------------------

请尝试执行下列操作:

单击刷新按钮,或稍后重试。

打开 127.0.0.1 主页,然后查找与所需信息相关的链接。
HTTP 错误 500.100 - 内部服务器错误 - ASP 错误
Internet 信息服务

--------------------------------------------------------------------------------

技术信息(用于支持人员)

错误类型:
Provider (0x80004005)
未指定的错误
/08ji/hd/login.asp, 第 24 行


浏览器类型:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; TencentTraveler )

网页:
POST 79 ??? /08ji/hd/login.asp

POST Data:
name=%E4%BF%A1%E6%81%AF&password=x+&button=%E7%99%BB%E5%85%A5%E4%B8%93%E5%8C%BA

时间:
2008年7月9日 星期三, 16:41:20


详细信息:
Microsoft 支持

 
请指导,谢谢。
搜索更多相关主题的帖子: 数据库 ASP 链接 
2008-07-09 16:47
towering
Rank: 7Rank: 7Rank: 7
等 级:黑侠
威 望:1
帖 子:261
专家分:507
注 册:2007-10-9
收藏
得分:0 
把你的代码帖上来看看呀!
2008-07-09 16:51
无忧当当
Rank: 1
等 级:新手上路
帖 子:40
专家分:0
注 册:2008-7-9
收藏
得分:0 
问题补充:
稍后进行调试时,输入正确的姓名和口令却转到登入错误界面。



在是ACCESS建立数据库时,已经有一个数据,ASP调试时就是根据此数据调试的
2008-07-09 16:52
无忧当当
Rank: 1
等 级:新手上路
帖 子:40
专家分:0
注 册:2008-7-9
收藏
得分:0 
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../Connections/hd.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("name"))
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 = "loginfailse.asp"

  MM_loginSQL = "SELECT name, password"
  If MM_fldUserAuthorization <> "" Then MM_loginSQL = MM_loginSQL & "," & MM_fldUserAuthorization
  MM_loginSQL = MM_loginSQL & " FROM zhanghao WHERE name = ? AND password = ?"
  Set MM_rsUser_cmd = Server.CreateObject (")
  MM_rsUser_cmd.ActiveConnection = MM_hd_STRING
  MM_rsUser_ = MM_loginSQL
  MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param1", 200, 1, 10, MM_valUsername) ' adVarChar
  MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param2", 200, 1, 20, Request.Form("password")) ' 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=utf-8" />
<title>登入专区</title>
<style type="text/css">
<!--
.STYLE3 {font-size: 9pt; font-family: "宋体"; }
.STYLE4 {
    color: #FF0000;
    font-weight: bold;
}
.url_menu {
    font-family: "宋体";
    font-size: 9pt;
    color: #000000;
    text-decoration: none;
}
-->
</style>
<link href="main.css" rel="stylesheet" type="text/css" />
<link href="../main.css" rel="stylesheet" type="text/css" />
<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('The following error(s) occurred:\n'+errors);
    document.MM_returnValue = (errors == '');
} }
//-->
</script>
</head>

<body>
<table width="200" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="845" height="134" colspan="9"><img src="../images/logo.png" alt="" name="logo" width="845" height="134" id="logo" /></td>
  </tr>
  <tr align="center" valign="middle" bordercolor="#C4B9AA" bgcolor="#C4B9AA">
    <td height="24"><span class="STYLE3"><a href="index.html" class="url_menu">首页</a></span></td>
    <td><span class="STYLE3">班委会</span></td>
    <td><span class="STYLE3">团支部</span></td>
    <td><span class="STYLE3">互动专区</span></td>
    <td><span class="STYLE3"><a href="wenjian/list.asp" class="url_menu">班级文件</a></span></td>
    <td><span class="STYLE3"><a href="gonggao/list.asp" class="url_menu">班级公告</a></span></td>
    <td><span class="STYLE3">友邻班级</span></td>
    <td><span class="STYLE3">教师专栏</span></td>
    <td><span class="STYLE3">关于我们</span></td>
  </tr>
  <tr align="center" valign="middle">
    <td height="24" colspan="9" align="left" class="STYLE3">当前位置 &gt;&gt; 互动专区 &gt;&gt; <span class="STYLE4">登入专区</span></td>
  </tr>
</table>
<table width="845" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="845" class="STYLE2">&nbsp;</td>
  </tr>
  <tr>
    <td class="STYLE2"><strong>只有班级成员和老师才能登入互动专区</strong></td>
  </tr>
  <tr>
    <td class="STYLE2">&nbsp;</td>
  </tr>
  <tr>
    <td class="STYLE2">&nbsp;</td>
  </tr>
</table>
<form ACTION="<%=MM_LoginAction%>" method="POST" name="form1" id="form1">
  <table width="845" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td width="336" align="right" class="STYLE2">姓名:</td>
      <td width="509" class="STYLE2"><label>
        <input name="name" type="text" id="name" />
      </label></td>
    </tr>
    <tr>
      <td align="right" class="STYLE2">口令:</td>
      <td class="STYLE2"><label>
<input name="password" type="password" id="password" size="22" />
忘记口令?</label></td>
    </tr>
    <tr>
      <td class="STYLE2">&nbsp;</td>
      <td class="STYLE2">&nbsp;</td>
    </tr>
    <tr>
      <td colspan="2" class="STYLE2"><label>                          
          <input name="button" type="submit" id="button" onclick="MM_validateForm('name','','R','password','','R');return document.MM_returnValue" value="登入专区" />
      </label>
        <label>
        <input type="reset" name="button2" id="button2" value="重新填写" />
        </label></td>
    </tr>
  </table>
</form>
<p>&nbsp;</p>
<p>&nbsp;</p>
</body>
</html>
2008-07-09 16:59
towering
Rank: 7Rank: 7Rank: 7
等 级:黑侠
威 望:1
帖 子:261
专家分:507
注 册:2007-10-9
收藏
得分:0 
在第13行后面加两行:
dim name,password
username=Trim(request("username"))
password=Trim(repuest("password"))
试试
2008-07-09 17:11
无忧当当
Rank: 1
等 级:新手上路
帖 子:40
专家分:0
注 册:2008-7-9
收藏
得分:0 
失败
2008-07-09 17:12
multiple1902
Rank: 8Rank: 8
等 级:贵宾
威 望:42
帖 子:4881
专家分:671
注 册:2007-2-9
收藏
得分:0 
好好的登录验证有必要这么复杂么……
2008-07-09 17:14
towering
Rank: 7Rank: 7Rank: 7
等 级:黑侠
威 望:1
帖 子:261
专家分:507
注 册:2007-10-9
收藏
得分:0 
有什么提示?
还是直接转入登陆失败页面?
2008-07-09 17:15
无忧当当
Rank: 1
等 级:新手上路
帖 子:40
专家分:0
注 册:2008-7-9
收藏
得分:0 
输入正确的姓名和口令转入失败界面
2008-07-09 17:16
towering
Rank: 7Rank: 7Rank: 7
等 级:黑侠
威 望:1
帖 子:261
专家分:507
注 册:2007-10-9
收藏
得分:0 
代码应该没有问题
检查一下你的用户名和密码

如果不是用户名和密码了就在DW中把登陆的服务器行为删除了重登陆行为吧
这也不过花费你几十秒的时间
2008-07-09 17:24
快速回复:ASP链接数据库问题!!!
数据加载中...
 
   



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

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