제로보드4는 공식적으로 더 이상 개발되지도 배포되지도 않습니다.
제로보드4를 사용하기 위한 팁보다 제로보드4를 안전하고 무사히 다른 툴로 이전하는 팁들을 게재해주시면 감사하겠습니다.
시간이 오래 지난 만큼 오래된 프로그램은 보안 및 사용성에 있어 문제가 많으니 이해 바랍니다.
글 수 4,549
처음 올려보네요..
이게 팁일줄은 잘 모르겠지만 유용할 것 같아서 올립니다.
홈페이지에 오늘과 어제 그리고 토탈 접속자 수를 표시해주는 카운터입니다.
주의할사항은 삽입되는 파일의 퍼미션을 꼭 777로 바꿔주시길 바랍니다.
편집은 워드패드나 노트패드로 해주시고 나모로 하시면 작동하지 않습니다.
아래 소스를 원하는 곳에 넣으시면 됩니다.
================================================
<?
// 주의사항 - 이 소스가 삽입되는 파일이 위치하는 폴더는 퍼미션이 777 이어야 한다.
// 그렇지 않으면 cnt.php 파일을 미리 만들고 퍼미션을 777로 설정하면 된다.
// 세션을 시작 - 이부분은 페이지의 처음에 와야한다.
session_start();
// 세션 변수를 전역변수로 선언한다.
global $cnt_session;
// 오늘 날짜를 구한다.
$today=date('d');
// 만약 카운터 정보 파일이 있으면
if(file_exists("./cnt.php"))
{
// 카운터 정보를 불러온다.
include "./cnt.php";
// 날짜가 변경되면 오늘 카운터 값을 초기화 시킨다.
if($cnt_date != $today)
{
$cnt_yday=$cnt_today; //어제 카운터에 기록시킨다.
$cnt_today=0;
}
// 세션 변수값이 설정되어 있지 않으면.. 즉, 접속이 시작되면
if(!$cnt_session)
{
// 전체와 오늘 카운터를 1씩 증가시킨다.
$cnt_total++;
$cnt_today++;
// 증가시킨 카운터 값과 오늘 날짜를 카운터 파일에 기록한다.
$kc_fp = @fopen("./cnt.php","w+");
@fwrite($kc_fp,"<? $cnt_total=$cnt_total; $cnt_yday=$cnt_yday; $cnt_today=$cnt_today; $cnt_date="$today"; ?>");
@fclose($kc_fp);
// 한명이 처음 접속 이후부터는 카운터 증가를 막기 위해 세션 변수에 값을 설정한다.
$cnt_session="on";
session_register("cnt_session"); // 세션 변수에 값을 설정
}
}
else
{
// 만약 처음으로 카운터를 실행하는 거라면 카운터 정보 파일이 없을때 새로 생성하고 초기값을 준다.
$kc_fp = @fopen("./cnt.php","w+");
@fwrite($kc_fp,"<? $cnt_total=1; $cnt_today=1; $cnt_yday=0; $cnt_date="$today"; ?>");
@fclose($kc_fp);
// 한명이 처음 접속 이후부터는 카운터 증가를 막기 위해 세션 변수에 값을 설정한다.
$cnt_session="on";
session_register("cnt_session"); // 세션 변수에 값을 설정
}
?>
<!-- 아래 부분을 카운터를 표시하고 싶은 부분에 넣어준다. -->
<table border=0 cellpadding=2 cellspacing=1 align=left style="display:inline;border-left:5px solid #ffffff;border-top:10px solid #ffffff;" id="count">
<tr >
<td bgcolor=#EEEEEE> 전 체 </td><td width=110 align=right bgcolor=#F7F7F7 style="letter-spacing:3px;padding-right:5px;color:#888888"><?=number_format($cnt_total)?></td>
</tr>
<tr >
<td bgcolor=#EEEEEE> 어 제 </td><td width=110 align=right bgcolor=#F7F7F7 style="letter-spacing:3px;padding-right:5px;color:#888888"><?=number_format($cnt_yday)?></td>
</tr>
<tr>
<td bgcolor=#EEEEEE> 오 늘 </td><td width=110 align=right bgcolor=#F7F7F7 style="letter-spacing:3px;padding-right:5px;color:#888888"><?=number_format($cnt_today)?></td>
</tr>
</table>
이게 팁일줄은 잘 모르겠지만 유용할 것 같아서 올립니다.
홈페이지에 오늘과 어제 그리고 토탈 접속자 수를 표시해주는 카운터입니다.
주의할사항은 삽입되는 파일의 퍼미션을 꼭 777로 바꿔주시길 바랍니다.
편집은 워드패드나 노트패드로 해주시고 나모로 하시면 작동하지 않습니다.
아래 소스를 원하는 곳에 넣으시면 됩니다.
================================================
<?
// 주의사항 - 이 소스가 삽입되는 파일이 위치하는 폴더는 퍼미션이 777 이어야 한다.
// 그렇지 않으면 cnt.php 파일을 미리 만들고 퍼미션을 777로 설정하면 된다.
// 세션을 시작 - 이부분은 페이지의 처음에 와야한다.
session_start();
// 세션 변수를 전역변수로 선언한다.
global $cnt_session;
// 오늘 날짜를 구한다.
$today=date('d');
// 만약 카운터 정보 파일이 있으면
if(file_exists("./cnt.php"))
{
// 카운터 정보를 불러온다.
include "./cnt.php";
// 날짜가 변경되면 오늘 카운터 값을 초기화 시킨다.
if($cnt_date != $today)
{
$cnt_yday=$cnt_today; //어제 카운터에 기록시킨다.
$cnt_today=0;
}
// 세션 변수값이 설정되어 있지 않으면.. 즉, 접속이 시작되면
if(!$cnt_session)
{
// 전체와 오늘 카운터를 1씩 증가시킨다.
$cnt_total++;
$cnt_today++;
// 증가시킨 카운터 값과 오늘 날짜를 카운터 파일에 기록한다.
$kc_fp = @fopen("./cnt.php","w+");
@fwrite($kc_fp,"<? $cnt_total=$cnt_total; $cnt_yday=$cnt_yday; $cnt_today=$cnt_today; $cnt_date="$today"; ?>");
@fclose($kc_fp);
// 한명이 처음 접속 이후부터는 카운터 증가를 막기 위해 세션 변수에 값을 설정한다.
$cnt_session="on";
session_register("cnt_session"); // 세션 변수에 값을 설정
}
}
else
{
// 만약 처음으로 카운터를 실행하는 거라면 카운터 정보 파일이 없을때 새로 생성하고 초기값을 준다.
$kc_fp = @fopen("./cnt.php","w+");
@fwrite($kc_fp,"<? $cnt_total=1; $cnt_today=1; $cnt_yday=0; $cnt_date="$today"; ?>");
@fclose($kc_fp);
// 한명이 처음 접속 이후부터는 카운터 증가를 막기 위해 세션 변수에 값을 설정한다.
$cnt_session="on";
session_register("cnt_session"); // 세션 변수에 값을 설정
}
?>
<!-- 아래 부분을 카운터를 표시하고 싶은 부분에 넣어준다. -->
<table border=0 cellpadding=2 cellspacing=1 align=left style="display:inline;border-left:5px solid #ffffff;border-top:10px solid #ffffff;" id="count">
<tr >
<td bgcolor=#EEEEEE> 전 체 </td><td width=110 align=right bgcolor=#F7F7F7 style="letter-spacing:3px;padding-right:5px;color:#888888"><?=number_format($cnt_total)?></td>
</tr>
<tr >
<td bgcolor=#EEEEEE> 어 제 </td><td width=110 align=right bgcolor=#F7F7F7 style="letter-spacing:3px;padding-right:5px;color:#888888"><?=number_format($cnt_yday)?></td>
</tr>
<tr>
<td bgcolor=#EEEEEE> 오 늘 </td><td width=110 align=right bgcolor=#F7F7F7 style="letter-spacing:3px;padding-right:5px;color:#888888"><?=number_format($cnt_today)?></td>
</tr>
</table>
아래와 같은 에러가 발생합니다.
어떻게 해결하는지 고수분들 부탁합니다.
=====================================================================================
// 세션을 시작 - 이부분은 페이지의 처음에 와야한다. session_start();
Warning: session_register(): Cannot send session cookie - headers already sent by (output started at /home1/wonpok/frame_right.htm:11) in /home1/wonpok/frame_right.htm on line 50
Warning: session_register(): Cannot send session cache limiter - headers already sent (output started at /home1/wonpok/frame_right.htm:11) in /home1/wonpok/frame_right.htm on line 50
어떻게 해결하는지 고수분들 부탁합니다.
=====================================================================================
// 세션을 시작 - 이부분은 페이지의 처음에 와야한다. session_start();
Warning: session_register(): Cannot send session cookie - headers already sent by (output started at /home1/wonpok/frame_right.htm:11) in /home1/wonpok/frame_right.htm on line 50
Warning: session_register(): Cannot send session cache limiter - headers already sent (output started at /home1/wonpok/frame_right.htm:11) in /home1/wonpok/frame_right.htm on line 50
