<!--#include file="conn.asp"-->
<%response.buffer=true
if request("uname")<>"" then
username=request("uname")
pwd=request("pwd")
sql="select * from userlog where uname='"&username&"' and upwd='"&pwd&"'"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof then
response.write "<script>alert('用户名或密码有误,请确认你的身份信息!');</script>"
else
username=request("uname")
pwd=request("pwd")
session("uname")=username
session("pwd")=pwd
session("userid")=rs("uID")
rs.close
response.Redirect("test.asp")
end if
end if
set rs=nothing
conn.close
set conn=nothing
%>