野心家

导航

统计网站访问人数示例

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>

<html>
  <head>   <title>统计网站访问人数页面</title>  </head>
  
  <body>
   <%!Integer yourNumber=new Integer(0); %>
   <%if(session.isNew()){
        Integer number=(Integer)application.getAttribute("Count");
        if(number==null)
        {number=new Integer(1);}
        else
        {number=new Integer(number.intValue()+1);}
        application.setAttribute("Count",number);
        yourNumber=(Integer)application.getAttribute("Count");
   }
    %>
    欢迎访问本站,您是第<%=yourNumber %>个访问用户!
  </body>
</html>

  

posted on 2017-11-05 13:35  野心家  阅读(675)  评论(0编辑  收藏  举报