exit.asp

来自「一套在线考试系统」· ASP 代码 · 共 44 行

ASP
44
字号
<!--#include file="conn.asp"-->
<%
  Dim DT
  Dim userid
  Dim starttime

  userid=request.cookies("myuserid")
  starttime=request.cookies("mystarttime")
  
  sql="select * from tongji where userid="&userid&" and starttime='"&starttime&"'"
  'response.write sql
  'response.End()
  rs.open sql,conn,3,2
  if not rs.eof then
    rs("online")=0
    DT=date()&" "&time()
    rs("endtime")=formatdatetime(DT)
    rs.update
  end if
  rs.close

  Response.Cookies("myuserid")=""
  Response.Cookies("myusername")=""
  Response.Cookies("mypwd")=""
  Response.Cookies("mydepartment")=""
  Response.Cookies("myoffice")=""
  Response.Cookies("myduties")=""
  Response.Cookies("myPOST")=""
  Response.Cookies("myrank")=""  
  
  if session("login")="ok" then
    set session("login")=nothing
    set session("myuserid")=nothing
    set session("myusername")=nothing
    set session("mydepartment")=nothing
    set session("myoffice")=nothing
    set session("myduties")=nothing
    set session("myPOST")=nothing
    set session("myrank")=nothing
    set session("mystarttime")=nothing
    set session("online")=nothing
  end if
  response.Redirect("../")
%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?