<!--由于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")%>位访问者
网站的访问统计代码
最新推荐文章于 2021-09-03 17:49:03 发布
本文介绍了一种使用服务器端application对象实现网页访问计数的方法。通过检查application中是否存在计数属性来初始化或递增访客数量,最终展示当前页面的累计访问次数。
1968

被折叠的 条评论
为什么被折叠?



