출근부 > 그누4 팁자료실

그누4 팁자료실

그누보드4와 관련된 팁을 여러분들과 함께 공유하세요.
나누면 즐거움이 커집니다.

출근부 정보

출근부

첨부파일

attendance.php (2.5K) 405회 다운로드 2005-07-05 15:42:44

본문

기존에 올렸던 출근부는 잘못된 소스로 퇴근부 역할을 하였습니다.
하여 prosper님의 도움으로 제대로 된걸 다시 올립니다.
추천
0

댓글 21개

(05-07-05 15:41)

[수정]
[2005. 07. 07. 14:00] 1차수정

1~24라인 아래소스를 수정해 주세요.

==============================  수정 전 ======================
<?
$g4_path = "..";
include_once ("$g4_path/common.php");
include_once("$g4[path]/head.php");

$g4[title] = "출근부 ($g4[time_ymd])";

$today = $g4[time_ymd];

$sql = " select count(*) as cnt
        from $g4[member_table]
where mb_today_login and mb_level  < '10' ";
$row = sql_fetch($sql);
$total_count = $row[cnt];
?>

<script language="javascript" src="<?=$g4[path]?>/js/sideview.js"></script>

<table align=center cellpadding="7" cellspacing="1" width="95%" bgcolor="#dadada">
<tr bgcolor=white height=50>
<td colspan=2 align=center valign=center><br><b>출근부</b><br><br>
<div align=right>오늘(<?=$g4[time_ymd]?>) <b><?=$total_count?></b> 분께서 출석하셨습니다.....^^</div></td>
</tr>
</table>
===============================================================

==============================  수정후  ============================
<?
$g4_path = "..";
include_once ("$g4_path/common.php");
include_once("$g4[path]/head.php");

$g4[title] = "출근부 ($today)";

$today = $g4[time_ymd];

// 총 출석자 확인
$sql = " select count(*) as cnt from $g4[member_table] where mb_today_login like '$today%' and mb_id != '$config[cf_admin]' order by mb_today_login"; $row = sql_fetch($sql);
$today_visit = $row[cnt];

?>

<script language="javascript" src="<?=$g4[path]?>/js/sideview.js"></script>

<table align=center cellpadding="7" cellspacing="1" width="95%" bgcolor="#dadada">
<tr bgcolor=white height=50>
<td colspan=2 align=center valign=center><br><b>출근부</b><br><br>
<div align=right>오늘(<?=$g4[time_ymd]?>) <b><?=$today_visit?></b> 분께서 출석하셨습니다.....^^</div></td>
</tr>
</table>
===============================================================
제 경우는 전체회원수도 방문객수도 아닌 그 중간에 어정쩡한 수치가 나오더군요. 그래서 몇분이 출석하셧습니다 그 부분은 눈물을 머금고 지워버렸습니다.
아꽈님//
그누폐인님//

1~24라인 아래소스를 수정해 주세요.

==============================  수정 전 ======================
<?
$g4_path = "..";
include_once ("$g4_path/common.php");
include_once("$g4[path]/head.php");

$g4[title] = "출근부 ($g4[time_ymd])";

$today = $g4[time_ymd];

$sql = " select count(*) as cnt
        from $g4[member_table]
where mb_today_login and mb_level  < '10' ";
$row = sql_fetch($sql);
$total_count = $row[cnt];
?>

<script language="javascript" src="<?=$g4[path]?>/js/sideview.js"></script>

<table align=center cellpadding="7" cellspacing="1" width="95%" bgcolor="#dadada">
<tr bgcolor=white height=50>
<td colspan=2 align=center valign=center><br><b>출근부</b><br><br>
<div align=right>오늘(<?=$g4[time_ymd]?>) <b><?=$total_count?></b> 분께서 출석하셨습니다.....^^</div></td>
</tr>
</table>
===============================================================

==============================  수정후  ============================
<?
$g4_path = "..";
include_once ("$g4_path/common.php");
include_once("$g4[path]/head.php");

$g4[title] = "출근부 ($today)";

$today = $g4[time_ymd];

// 총 출석자 확인
$sql = " select count(*) as cnt from $g4[member_table] where mb_today_login like '$today%' and mb_id != '$config[cf_admin]' order by mb_today_login"; $row = sql_fetch($sql);
$today_visit = $row[cnt];

?>

<script language="javascript" src="<?=$g4[path]?>/js/sideview.js"></script>

<table align=center cellpadding="7" cellspacing="1" width="95%" bgcolor="#dadada">
<tr bgcolor=white height=50>
<td colspan=2 align=center valign=center><br><b>출근부</b><br><br>
<div align=right>오늘(<?=$g4[time_ymd]?>) <b><?=$today_visit?></b> 분께서 출석하셨습니다.....^^</div></td>
</tr>
</table>
===============================================================
당장 제 홈피에 적용했습니다. 감사합니다.그런데 사람마음이 간사한 바가 있어 이정도도 너무나 감사하고 감지덕지한데 그누보드사이트 SIR에 달린 접속중 표시가 나오는 출근부를 보니 이 기능도 욕심이 나는군요. 암튼 욕심엔 한이 없나 봅니다^^
Warning: main(../common.php): failed to open stream: No such file or directory in g4\attendance.php on line 3

Warning: main(): Failed opening '../common.php' for inclusion (include_path='.') in g4\attendance.php on line 3

Warning: main(/head.php): failed to open stream: No such file or directory in g4\attendance.php on line 4

Warning: main(): Failed opening '/head.php' for inclusion (include_path='.') in g4\attendance.php on line 4

Fatal error: Call to undefined function: sql_fetch() in g4\attendance.php on line 13

음 이런 뭐가 잘 못 되서 그런거죠..-0-;;(초보라 좀 어렵네요..)

왜 나한테만 반항인건징. -0-;
적용하신 곳의 주소를 알면 더 쉽게 파악이 되겠지만 위 내용으로만 본다면 경로문제인듯 한데요.......
root님의 아래 팁을 참고하시어 경로설정을 다시 해 보시기 바랍니다.

http://sir.co.kr/bbs/board.php?bo_table=g4_tiptech&wr_id=271&page=3
http://eznara.info/gnuboard4.00.19/attendance.php

도둑님 php.ini 에서 세션 세팅을 하셔야할꺼 같네요..
PHPSESSID=cd691e51e3eebbcadd1bd6e6d572c974 URL에 따라 댕깁니다 :)
G4에는 해당 세션아이디를 날려주는것이 추가되어있어서 별상관은 없으나..
마음만 먹으면 관리자아이디를 꿀꺽할수있습니다.

쿠키 = 클라이언트용 저장, 세션 = 서버용 저장 이라는 정도만 아시면되는데
문제는 서버에 저장되는 개인정보가.. 따라댕긴다고 생각해보시면 답은 나옵니다.

일예로 way.co.kr의 운영자깨서 몇년전에 쿠키 인젝션 취약점을 발표했었던적이 있죠..

쿠키의 경우 pc방에서 조금만 긁으면 자동로그인되어있는 정도 id,이름,pw,이메일등을 추출해낼수있습니다.

서버측의 세션은 그정보를 보지 못하기때문에 안전한것인데..

그 세션의 id로 해당 값이 붙어다닌다면???      :)
전체 29 |RSS
그누4 팁자료실 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT