dim username,ps,Page
username=replace(request.Form("UserName"),"'","")
ps=replace(request.Form("Password"),"'","")
Set rs=Server.CreateObject("adodb.recordset")
sql="select * from Customer where User_Name='"&username&"' and User_Password='"&ps&"'"
rs.open sql,FF_Conn_String,1,3
if rs.eof then
response.Write("<script langauge=javascript>alert('登陆失败!');history.back();</script>")
else
Session("User_Name")=rs("User_Name")
Session("User_ID")=rs("User_ID")
Session("LastTime")=rs("LastTime")
Session("Grade_Class")=rs("Grade")
rs("LastTime")=Now()
rs.update
if Session("LastPage")="" Then
Page=Request.ServerVariables("HTTP_REFERER")
Else
Page=Session("LastPage")
end if
Set Rst=FF_Conn_String.Execute("Select Fraction from Fraction where ID=1")
IF not RSt.eof and Datediff("d",now,session("LastTime"))>1 then
FF_Conn_String.Execute("Update Customer Set Fraction=Fraction+"&rst(0)&" where User_ID="&Rs("User_ID")&"")
End IF
Set Rst=Nothing