사이트 내 전체검색
그누보드
최적화 파일등록시 파일존재여부 확인하지 않기..
최고관리자
https://cmd.kr/gnu/46 URL이 복사되었습니다.

본문

write_update.php 에서.. 업로드파일존재여부는 갱신일때만 확인하면 된다.

// 업로드된 파일 내용에서 가장 큰 번호를 얻어 거꾸로 확인해 가면서
// 파일 정보가 없다면 테이블의 내용을 삭제합니다.
// 등록일때만 확인하면된다.
if ($w=='u') {
 $row = sql_fetch(" select max(bf_no) as max_bf_no from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$wr_id' ");
 for ($i=(int)$row[max_bf_no]; $i>=0; $i--)
 {
  $row2 = sql_fetch(" select bf_file from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$wr_id' and bf_no = '$i' ");

  // 정보가 있다면 빠집니다.
  if ($row2[bf_file]) break;

  // 그렇지 않다면 정보를 삭제합니다.
  sql_query(" delete from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$wr_id' and bf_no = '$i' ");
 }
}
//------------------------------------------------------------------------------

댓글목록

등록된 댓글이 없습니다.

그누보드
190 (4/4P)

Search

Copyright © Cmd 명령어 3.128.197.164