我的一个注册程序,不知道错在哪里?
我注册了好多用户,但是登陆时,却只能登陆一个用户,而且是第一个注册的那个用户:
代码如下:
<!--#Include file="linkdata.asp"-->
<!--#Include file="hnzjzz_md5.asp"-->
<%
if request("action")="login" then Call login()
if request("action")="quit" then Call quit()
Sub login()
name=md5(Replace(Trim(Request.form("user_name")),"","'"))
pass=md5(Replace(Trim(Request.form("user_pass")),"","'"))
Set rs= Server.CreateObject("ADODB.Recordset")
sql="select id,user_name,user_pass from users"
rs.open sql,conn,1,1
if name<>rs("user_name") then
Response.Write "<script language=javascript>alert('用户不正确!');self.location=(""login.asp"");</script>"
elseif pass<>rs("user_pass") then
Response.Write "<script language=javascript>alert('密码不正确!');self.location=(""login.asp"");</script>"
else
Response.Write "<script language=javascript>alert('登陆成功!');self.location=(""Myzone.asp"");</script>"
Session("user_name")=rs("user_name")
end if
End Sub
Sub quit()
Session("user_name")=""
Response.Write "<script language=javascript>alert('退出成功!');self.location=(""login.asp"");</script>"
End Sub
%>

我很想把计算机学好!!