網站的訪問統計代碼

<!--由於application一直存在於服務器端,可以利用此特性對網頁記數-->
<%
if(application.getAttribute("count")==null)
application.setAttribute("count","1");
else
application.setAttribute("count",Integer.toString(Integer.valueOf(application.getAttribute("count").toString()).intValue()+1));
%>
你是第<%=application.getAttribute("count")%>位訪問者

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章