asp参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。
数据库连接页面logindb.asp:<body><%setconn=Server.CreateObject("adodb.connection")connstr="pr...
数据库连接页面logindb.asp:
<body>
<%
set conn= Server.CreateObject("adodb.connection")
connstr="provider=microsoft.jet.oledb.4.0;
data source="&server.MapPath("../login/db/login.mdb")
conn.open connstr
%>
</body>
</html>
登陆页面check.asp:
<body>
<%
dim get_name, get_password
get_name = trim(request("username"))
get_password = Trim(request("password"))
dim strsql,rs
strsql = "select username, password from user where username " = request("password")
set rs = server.CreateObject("adodb.recordset")
rs.open strsql,conn,1,3
if rs.eof then
%>
<script language="javascript">
alert("invide user!");
</script>
<%
else if get_password <> rs.fields("password") then
%>
<script language="javascript">
alert("wrong password!");
</script>
<%
else
response.Redirect("marketac.html")
end if
end if
%>
</body>
</html>
在线等,大虾们帮帮手!!!
花血本了啊,我穷透了 展开
<body>
<%
set conn= Server.CreateObject("adodb.connection")
connstr="provider=microsoft.jet.oledb.4.0;
data source="&server.MapPath("../login/db/login.mdb")
conn.open connstr
%>
</body>
</html>
登陆页面check.asp:
<body>
<%
dim get_name, get_password
get_name = trim(request("username"))
get_password = Trim(request("password"))
dim strsql,rs
strsql = "select username, password from user where username " = request("password")
set rs = server.CreateObject("adodb.recordset")
rs.open strsql,conn,1,3
if rs.eof then
%>
<script language="javascript">
alert("invide user!");
</script>
<%
else if get_password <> rs.fields("password") then
%>
<script language="javascript">
alert("wrong password!");
</script>
<%
else
response.Redirect("marketac.html")
end if
end if
%>
</body>
</html>
在线等,大虾们帮帮手!!!
花血本了啊,我穷透了 展开
2个回答
展开全部
strsql = "select username, password from user where username " = request("password")
这个应该写成
strsql = "select username, password from [user] where username = '" &get_name&"'" and password='"&get_password&"'" '同时验证用户名和密码
或者写成
strsql = "select username, password from [user] where username = '" &get_name&"'" '先验证用户名,后边再验证密码
这个应该写成
strsql = "select username, password from [user] where username = '" &get_name&"'" and password='"&get_password&"'" '同时验证用户名和密码
或者写成
strsql = "select username, password from [user] where username = '" &get_name&"'" '先验证用户名,后边再验证密码
展开全部
strsql = "select username, password from user where username " = request("password")
改成
strsql = "select username, password from [user] where username " = request("password")
user是access数据库的保留字要用[]括住
改成
strsql = "select username, password from [user] where username " = request("password")
user是access数据库的保留字要用[]括住
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询