| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 528 人关注过本帖
标题:帮我看看那里有问题啊!!
只看楼主 加入收藏
blackkey
Rank: 1
等 级:新手上路
帖 子:159
专家分:0
注 册:2005-6-8
收藏
 问题点数:0 回复次数:1 
帮我看看那里有问题啊!!

!<!-- #include file="conn.asp" --> <!--包含数据库连接文件-->

<% session.Timeout=15 if request.Form("SUSER01")<>"" and request.Form("SUSER02")<>"" then session("UserName")=request.Form("SUSER01") session("PWD")=request.Form("SUSER02") session("QX")=request.Form("UPDATA04") set rs=server.createobject("ADODB.recordset") rs.open "select * from S_USER where SUSER01='"&session("SUSER01"))&"'",conn,1,1 if rs.eof then %> <script language="javascript"> alert("您输入的管理员名称错误!"); </script> <% else session("SUSER03")=rs("SUSER03") if rs("SUSER02")=session("PWD") then %>

<script language="javascript"> window.location.href="index.asp" </script> <%else%> <script language="javascript"> alert("您输入的管理员密码错误,请重新输入!"); history.back(); </script> <%end if end if end if %> <script language="javascript"> function mycheck(){ if (myform.SUSER01.value=="") {alert("请输入操作员姓名!");myform.UserName.focus();return;} if(myform.SUSER02.value=="") {alert("请输入密码!");myform.PWD.focus();return;} form1.submit(); } </script>

<!---------------------------------二级下拉菜单-(begin)--------------------------------> <% set rs=server.createobject("adodb.recordset") sql = "select * from S_USER1" rs.open sql,conn,1,3

%> <SCRIPT language="JavaScript"> var onecount; onecount=0; subcat = new Array(); <% count = 0 do while not rs.eof %> subcat[<%=count%>] = new Array("<%= trim(rs("SUSER06"))%>","<%= trim(rs("SUSER04"))%>","<%= trim(rs("SUSER07"))%>"); <% count = count + 1 rs.movenext loop rs.close %> onecount=<%=count%>; function changelocation( locationid ) {document.myform.buildingclass.length = 0; var locationid=locationid; var i; for (i=0;i < onecount; i++) { if (subcat[i][1] == locationid) { document.myform.buildingclass.options[document.myform.buildingclass.length] = new Option(subcat[i][0], subcat[i][2]); } } } </SCRIPT> <!---------------------------------二级下拉菜单-(end)-------------------------------->

<form name="myform" method="post" action="login2.asp"> <table width="250" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="25" colspan="2" align="center">登陆页面</td> </tr> <tr> <td width="76" height="25">权&nbsp;&nbsp;限:</td> <td width="174" height="25"> <% sql = "select * from S_USER" rs.open sql,conn,1,1 if rs.eof and rs.bof then response.write "请先<a href='precinct_add.asp'>添加社区</a>。" response.end else %> <select name="SUSER01" onChange="changelocation(document.myform.SUSER01.options[document.myform.SUSER01.selectedIndex].value)" size="1" > <option>==请选择==</option> <%do while not rs.eof%> <option value="<%=trim (rs("SUSER04"))%>"><%=trim (rs("SUSER01"))%></option> <% rs.movenext loop end if rs.close set rs = nothing conn.Close set conn = nothing %> </select> </td> </tr> <tr> <td height="25">用户名:</td> <td height="25"> <SELECT name="buildingclass"> <OPTION selected value>==请选择==</OPTION></SELECT> </td> </tr> <tr> <td height="12" align="center">密&nbsp;&nbsp;码:</td> <td height="12"> <input name="SUSER02" type="password" id="SUSER02" size="15" onKeyPress="EnterE(document.myform.Button)" ></td> </tr> <tr> <td height="13" colspan="2" align="center"> <input type="submit" name="Submit" value="提交" onClick="mycheck()"> &nbsp; <input type="reset" name="Submit2" value="重置"></td> </tr> </table> </form> 当我输入正确的帐户和密码的时候它总是提示:您输入的管理员名称错误! 帮我看看看啊~~

搜索更多相关主题的帖子: javascript 数据库连接 include 管理员 where 
2005-08-09 13:15
盒子
Rank: 1
等 级:新手上路
帖 子:16
专家分:0
注 册:2005-8-7
收藏
得分:0 
请问你的用户名是在什么地方输的?把你的代码看了一下,用户名的值好像只有一个 "==请选择==" 没有别的了.少了对数据库用户名的查询语句
2005-08-09 17:50
快速回复:帮我看看那里有问题啊!!
数据加载中...
 
   



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

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