====================================================================
KKAOK count ver2.1
제작자 : kkaok ( jack1972@naver.com )
홈페이지 : http://www.kkaok.pe.kr
날짜 : 2002년 8월 6일
====================================================================
1. 소스는 수정 배포 될수 있으며 수정 배포시 원 제작자를 명시하여야 한다.
2. 상업성 사이트에서의 사용은 금지한다.
3. 소스자체를 상업적(소스의 판매,대여등)으로 이용할 수 없다.
4. 이 프로그램의 사용으로 인한 어떠한 피해에도 제작자는 책임을 지지 않는다.
■ 테스트 URL
http://www.kkaok.pe.kr/
■ 개발 환경
Windows 2000 , Tomcat3.2.3, oracle 8.1.6, jdk 1.3.1
■ 테스트 환경
Windows 2000 , Tomcat3.2.3, oracle 8.1.6, jdk 1.3.1
■ 설치방법
1. oracle을 실행하시고 kguestBook.sql에 있는 내용을 실행 시키세요
2. web-inf/classes/db.properties 이 화일의 내용을 자신의 환경에
맞게 고치세요
3. web-inf/classes/common/config.java 이 화일의 내용을 자신의 환경에
맞게 고치세요
4. 각 class 화일들을 컴파일하시고 테스트 하시면 됩니다.
5. test page : http://www.kkaok.pe.kr
sql
----------------------------------------------------------------
CREATE TABLE kcount (
idx number not null,
cdate NUMBER(8),
ctime NUMBER(4),
dayofweek NUMBER(1),
ip varchar2(20),
referer varchar2(200),
browser varchar2(20),
os varchar2(20),
constraint kcount_pk_idx Primary Key (idx)
);
create index kcount_cdate_indx on kcount(cdate,idx);
create index kcount_dayofweek_indx on kcount(dayofweek);
스크린샷






카운터올리기
---------------------------------------------------------------
<%@ page contentType="text/html; charset=EUC-KR" import="java.util.*"%>
<jsp:useBean id="ct" scope="request" class="count.Count" />
<%
try{
ct.todayCount(request,response);
}catch(Exception e){
System.out.println(e);
}
%>
-----------------------------------------------------------------
위의 소스를 user가 지나다니는 톨로에 붙여 놓으세여
저의 경우 index.jsp에서 세개의 프레임을 나눠쓰고 있는데 그중 첫페이지인
index.jsp의 경우 모든 사람이 이곳을 경유하기 때문에 이곳에 붙여 놨습니다.
카운터보기
----------------------------------------------------------------
<%@ page contentType="text/html; charset=EUC-KR" import="java.util.*"%>
<jsp:useBean id="ct" scope="request" class="count.Count" />
<%@ include file="/kcount/inc/refresh.jsp" %>
<%
int today = 0;
int total = 0;
try{
ct.getStatistics();
today = ct.getToday();
total = ct.getTotalSum();
}catch(Exception e){
System.out.println("카운터에서 에러여" + e);
}
%>
오늘의 카운터 : <%=today%> <br>
전체 카운터 : <%=total%><br>
<a href="javascript:OpenWinCount('/servlet/count.Statics',520,520)">
▒ 통계보기 ▒</a><br>
<script language="javaScript">
<!--
function OpenWinCount(URL,width,height) {
var str,width,height;
str="'toolbar=no,location=no,directories=no,status=no,menubar=no,
scrollbars=yes,resizable=no,copyhistory=no,";
str=str+"width="+width;
str=str+",height="+height+"',top=150,left=250";
window.open(URL,'remote',str);
}
// -->
</script>