<%
Sub online()
dim username,sex,grade,UserIP
	username=request.Cookies("asp163")("username")
	sex=request.Cookies("asp163")("sex")
	grade=request.Cookies("asp163")("grade")
	set rs=Server.CreateObject("ADODB.recordset")
	rs.open"select * from love_online_sm where username='"&username&"'",conn,1,3
		if rs.eof and rs.bof then
			rs.addnew
			rs("username")=username
			rs("sex")=sex
			rs("grade")=grade
			rs("ip")=UserIP
			rs("logintime")=now()
			rs("lasttime")=now()
			rs.update
		else
			rs("lasttime")=now()
			rs.update
		end if
	rs.close
	set rs=nothing
'response.Write(datediff("n","2004-9-28 19:50:07",Now()))
'response.end
set rs=Server.CreateObject("ADODB.recordset")
rs.open"select username,lasttime,logintime from love_online_sm order by lasttime desc",conn,1,1
do while Not rs.eof
	If int(datediff("n",rs("lasttime"),now()))>=200 then
		'response.Write(datediff("n",rs("lasttime"),now()))
		conn.execute("delete from love_online_sm where username='"&rs("username")&"'")
	end if
rs.movenext
loop
rs.close:set rs=nothing
End  Sub

%>





