ASP高手请看,登陆判断问题

来源:百度知道 编辑:UC知道 时间:2024/06/18 14:20:07
登陆表单:<form name="form1" method="post" action="login.asp">
<table width="150" border="0" align="center" cellpadding="3" cellspacing="0">

<tr>
<td width="143" align="right">姓名:</td>
<td width="140"><input name="name" class="goto" size="14" type="text" id="name"></td>
</tr>
<tr>
<td align="right">密码:</td>
<td><input name="password" type="password" size="14" class="goto" id="password"></td>
</tr>
<tr align="center">
<td colspan="2"><input type="submit" class="goto" name="Submit" value="提交&q

------你试试看-------
判断login.asp:
<!--#include file="conn.asp"-->
<% dim username,password
username=request.form("name")
password=request.form("password")
if username="" or password="" then
response.Write "<script LANGUAGE='javascript'>alert('用户名或密码不能为空!');history.go(-1);</script>"
response.end
end if
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from info where name='"&username&"' and password='"&password&"'",conn,1,1
if not rs.eof then
session("name")=username
rs.Close
set rs=nothing
response.Redirect "index.asp"
else
response.write "<script LANGUAGE='javascript'>alert('您输入的用户名不存在或密码错误!');history.go(-1);</script>"
end if
%>

问题是什么啊