<!-- #include file="conn.asp" -->
<!--#include file="inc/md5.asp"-->
<%
memberid=replace(trim(request("memberid")),"'","")
password=replace(trim(Request("password")),"'","")

dim sql
sql="select * from member where memberid='"&memberid&"'and password='"&password&"'"
rs.open sql,conn,1,3
if not(rs.bof and rs.eof) then
    id=rs("ID")
    conn.Execute("update member set nos = nos+1 where id="&id)
    response.cookies("memberid")      = rs("memberid")
    response.cookies("oklook")        = rs("oklook")
    response.cookies("okerer")        = "yesok"   
    response.cookies("myter")         = "yes"
	response.cookies("ifchehang")     = cstr(rs("ifchehang"))



	response.cookies("login_time")   = now()
	session("userId23")   = id
	session("userName")   = rs("memberid")
	
	if rs("ifchehang")  = "0" then
		session("ifchehang") = "no"
	else
	 	session("ifchehang") = "yes"
	end if
	
	if rs("ifpinggushi")  = "0" then   'sun增加的
		session("ifpinggushi") = "no"
	else
	 	session("ifpinggushi") = "yes"
	end if
	
else
   Response.write("<script>alert(""\对不起！您的会员帐号或密码不正确，请重新输入！"");location.href=""default.asp"";</script>")
   response.end
end if

rs.close
set rs=nothing
conn.close
set conn=nothing
session.Timeout = 300					'session过期时间为300分钟

if session("zucheing") = "yes" then
	response.Redirect "rent/rent2.asp"
else
	response.Redirect "user_main.asp"
end if
%>

