<!--#Include file="include/conn.asp"-->
<%'------获取传递过来的表单数据
userName_form=Trim(Request.Form("userName"))
passWord_form=Trim(Request.Form("passWord"))
'------判断登陆的帐号与密码的合法性
getConn()
userSql="select * from UserInfo where UserName='"&userName_form&"'"
rs.Open userSql,conn,1,1
If rs.Eof Then
  errmsg="不存在此用户，请注册！"
  returnURL="register.htm"
ElseIf rs("PassWord")<>passWord_form Then
  errmsg="密码不正确，请重新登陆！"
  returnURL="default.htm"
Else
  Session("userName")=userName_form
  errmsg="登录成功！进入通讯录！"
  returnURL="index.asp"
End If
Set rs=Nothing
Set conn=Nothing
%>
<HTML>
<HEAD>
<META http-equiv="Refresh" content='1;URL=<%=returnURL%>'>
<META http-equiv="Content-Type" content="text/html; charset=gb2312">
</HEAD>
<BODY>
<P align="center"><%=errmsg%>
</BODY>
</HTML>