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

来源:互联网 发布:centos安装yum命令 编辑:程序博客网 时间:2024/05/21 14:48
<%Sub chkreflash()dim ScriptNameScriptName=lcase(request.ServerVariables("PATH_INFO"))dim posttime,DoReflashPage,ReflashPage,SplitReflashPageposttime=86400 '防止刷新时间DoReflashPage=falseReflashPage="|Article_one.asp"SplitReflashPage=split(ReflashPage,"|")for i=0 to ubound(SplitReflashPage)if instr(scriptname,SplitReflashPage(i))>0 thenDoReflashPage=trueexit forend ifnextif (not isnull(session("ReflashTime"))) and posttime>0 and DoReflashPage thenif DateDiff("s",session("ReflashTime"),Now())<posttime thenresponse.Redirect(syurl)elsesession("ReflashTime")=Now()end ifelseif isnull(session("ReflashTime")) and posttime>0 and DoReflashPage thenSession("ReflashTime")=Now()end ifEnd Sub%>
0 0