View Source
Go Back to /jang/books/webprog/06asp/example/session/pagehit2.asp
Go Back to WWW sandbox
<%@language=JScript%>
<%title="使用 Application 與 Session 物件來防止計數資料的竄改:方法二"%>
<!--#include file="../head.inc"-->
<hr>

<%
URL = Request.ServerVariables("URL");
now = new Date();
if (Application(URL)==null)
      Application(URL&"StartTime") = now.toLocaleString();
if (Session(URL)==null){
      Application(URL)++;
      Session(URL)="junk";
} else {%>

      <SCRIPT>
      alert("你想竄改記數器?沒那麼容易喔!");
      </SCRIPT>

<%}%>
<h3 align=center>從 <font color=green><%=Application(URL&"StartTime")%></font> 以來,您是第 <font color=red><%=Application(URL)%></font> 位貴賓!</h3>

<hr>
<!--#include file="../foot.inc"-->