ASP防止刷新,效果很实用啊,。

时间:2021-03-31 16:59:45
<% Sub chkreflash() dim ScriptName ScriptName=lcase(request.ServerVariables("PATH_INFO")) dim posttime,DoReflashPage,ReflashPage,SplitReflashPage posttime=86400 '防止刷新时间 DoReflashPage=false ReflashPage="|Article_one.asp" SplitReflashPage=split(ReflashPage,"|") for i=0 to ubound(SplitReflashPage) if instr(scriptname,SplitReflashPage(i))>0 then DoReflashPage=true exit for end if next if (not isnull(session("ReflashTime"))) and posttime>0 and DoReflashPage then if DateDiff("s",session("ReflashTime"),Now())<posttime then response.Redirect(syurl) else session("ReflashTime")=Now() end if elseif isnull(session("ReflashTime")) and posttime>0 and DoReflashPage then Session("ReflashTime")=Now() end if End Sub %>