如何统计我的网站的访问量啊?
admin 发表于 2010-07-18 | 来源:互联网 | 阅读:

我想统计有多少人访问了我的网站。应该如何统计呢

我记得是在SESSION里面写个公共变量什么的

具体怎么写啊?
谢谢

已经有16 个评论
  1. geqian5 说:

    监 听

  2. doing7 说:

    application里面记录点击次数啊, 然后写入数据库.

  3. xiaobao520 说:

    application

  4. 天天累 说:

    <%@ page contentType="text/html;charset=gb2312" language="java"%>  <%!  synchronized void countPeople()  {    ServletContext application=getServletContext();    Integer number=(Integer)application.getAttribute("Count");    if(number==null){    number=new Integer(1);    application.setAttribute("Count",number);  }else{    number=new Integer(number.intValue()+1);    application.setAttribute("Count",number);  }} %>  <%  if(session.isNew())  {countPeople();  Integer myNumber=(Integer)application.getAttribute("Count");  session.setAttribute("MyCount",myNumber);  }  %><h3 align="center">您是第<font color="red"><%  int a;  if(session.getAttribute("MyCount")!=null)  {a=((Integer)session.getAttribute("MyCount")).intValue();}  else  {a=1;}    %><%=a %></font>个访问本站的客户。</h3> 

  5. nrc001 说:

    LZ想要怎么统计?是不是想把在线人数显示在页面上?还是想分析数据?

  6. mikeyao210 说:

    application

  7. forestyaser 说:

    <%@ page contentType="text/html;charset=gb2312" language="java"%> <%! synchronized void countPeople() { ServletContext application=getServletContext(); Integer number=(Integer)applica……up!!!

  8. boysee 说:

    使用Application就可以

  9. 15375 说:

    session监听

  10. mikeyao210 说:

    application登录了就加1

  11. waterskin 说:

    <%@ page contentType="text/html;charset=gb2312" language="java"%> <%! synchronized void countPeople() { ServletContext application=getServletContext(); Integer number=(Integer)applica……登录了就加1 session 就够了

  12. geqian5 说:

    application

  13. 萌芽邪恶 说:

    统计Cookie 的id也行啊

  14. awaywind 说:

    可以交给第三方的流量统计厂商google的是免费的,在你的首页嵌入它提供的一段js脚本即可,登录google的统计分析站点可以看到你的网站的详细流量信息,很方便

  15. forestyaser 说:

    统计Cookie 的id也行啊同意楼上,用application大家认为可行吗?

  16. waterskin 说:

    可以交给第三方的流量统计厂商google的是免费的,在你的首页嵌入它提供的一段js脚本即可,登录google的统计分析站点可以看到你的网站的详细流量信息,很方便搞错了,楼上说的很对,楼主看看吧!

我要评论

评论功能因故关闭!

请加入我们的QQ群一起参与讨论:群号59400482(500人超级群)


返回首页 | 关于我们 | 联系我们 | 广告合作 | 网站地图 | 友情链接 | 版权声明