MVC

방문회수//

웨이칭 2020. 7. 22. 19:07

새로고침 / 다른 Web브라우져에서 접속 할 수록 방문회수가 1씩 늘어남.

<body>
<%
	int c;

	if(session.getAttribute("count") != null){
		c = (Integer)session.getAttribute("count");
	}else{
		c = 0;
	}
	
	c++;
%>

방문회수:<input type="text" value="<%=c %>" size="5">회

<%
session.setAttribute("count", new Integer(c));
%>
</body>