<! #include file="/inc/connasp">
<! #include file="/inc/mdasp">
<%
if cstr(request("code"))<>cstr(session("getcode")) then
responsewrite"<SCRIPT language=JavaScript>alert(对不起你填写的验证码错误!);"
responsewrite"javascript:historygo()</SCRIPT>"
responseend
end if
dim useridpassword
username=request("username")
password=md(request("password"))
set rs=serverCreateObject("adodbrecordset")
sql="select usernamevipjifenlastloginthisloginlogins from tgy where username="&username&"and password="&password&""
rsopen sqlconn
if rseof then
responseWrite "<script>alert(用户登录出错用户名或者密码错误);historygo();</Script>"
else
session("username")=rs("username")
if day(rs("lastlogin"))<>day(date()) then
if rs("jifen")="" or isnull(rs("jifen")) then
rs("jifen")=
else
rs("jifen")=rs("jifen")+
end if
end if
rs("lastlogin")=rs("thislogin")
rs("thislogin")=now()
rs("logins")=rs("logins")+
rsupdate
sessiontimeout=
responseWrite "<script>location;</Script>"
end if
rsclose
set rs=nothing
connclose
set conn=nothing
%>