<!--#include file="mdb.asp"-->
<!--#include file="md5.asp"-->
<!--#include file="config.asp"-->
<%dim Expires,UserPass
UserName=request("UserName")
UserPass=md5(request("UserPass"),16)
Expires=request("IsSave")
if UserName<>"test" then

set rs=server.createobject("adodb.recordset")
rs.open"select * from lg50_my_user where username='"&username&"' and password='"&UserPass&"'",conn,1,3
if rs.eof and rs.bof then
	rs.close
	set rs=nothing
	Response.Write("<script language=javascript>alert('请输入正确用户名和密码');this.location.href='login.htm';</script>")
	Response.End
else
   response.cookies(cookiesname)("username")=UserName
   if int(Expires)>0 then Response.Cookies(cookiesname).Expires = date+Expires
      Response.Redirect ("index.asp")
end if

else
   response.cookies(cookiesname)("username")=UserName
      Response.Redirect ("index.asp")
	  Response.End
end if
%>

