첨부파일 10개 이후 list_all 파일 에러

2005.01.31
유용한 팁 란에서 첨부파일 10개로 늘리기 방법을 배워서 10개로 늘려서 잘 쓰고 있습니다. 한데 게시물중 몇가지만 선택해서 한꺼번에 보는 기능(리스트 기능)을 사용하려고 하면 이것저것 물어본 후 마지막으로 화면 바뀔때 아래 에러메시지가 뜹니다.

Parse error: parse error, unexpected $end in D:PC OnlineASPzblist_all.php on line 360


line 360(마지막 라인) 에는  ?>  밖에 없는데 왜 이런 일이 발생하는 것인지 혹 아시는 분 계시면 알려주시면 감사하겠습니다. 대류님께서 이 부분과 관련해 질문받지 않으시는 것은 알지만 혹시 감이라도 잡히시기는 것이 있으면 알려주시면 감사하겠습니다.


아래는 제 list_all.php의 소스코드 입니다.

<?
/**********************************************************************************
* 공통 파일 include
*********************************************************************************/
        include "_head.php";

/**********************************************************************************
* 설정 체크
*********************************************************************************/
        // 그룹 정보 구해오기
        $setup=get_table_attrib($id);

        // 사용권한 체크
        if($exec=="view_all"&&$setup[grant_view]<$member[level]&&!$is_admin) Error("You do not have permission","login.php?id=$id&page=$page&page_num=$page_num&category=$category&keykind=$keykind&keyword=$keyword&no=$no&file=zboard.php");

        if($exec!="view_all") unset($setup);

        if(!$is_admin&&$exec!="view_all") Error("You do not have permission","login.php?id=$id&page=$page&page_num=$page_num&category=$category&keykind=$keykind&keyword=$keyword&no=$no&file=zboard.php");

        $select_list=$selected;
        $selected=explode(";",$selected);

        if($exec=="copy_all") $_kind = "Copy";
        elseif($exec=="move_all") $_kind = "Move";
        elseif($exec=="delete_all") $_kind = "Delete";

/**********************************************************************************
* 쪽지 보내는 함수 간단하게 사용할수 있는 것
*********************************************************************************/
        function _send_message($to, $from, $subject, $memo) {

                global $get_memo_table, $send_memo_table, $member_table;

                $reg_date = time();

                mysql_query("insert into $get_memo_table (member_no,member_from,subject,memo,readed,reg_date)
                                        values ('$to','$from','$subject','$memo',1,'$reg_date')") or error(mysql_error());

                mysql_query("insert into $send_memo_table (member_to,member_no,subject,memo,readed,reg_date)
                                        values ('$to','$from','$subject','$memo',1,'$reg_date')") or error(mysql_error());

                mysql_query("update $member_table set new_memo=1 where no='$to'") or error(mysql_error());
        }


/**********************************************************************************
* View_All 일때 (선택된 게시물 보기)
*********************************************************************************/

        if($exec=="view_all") {

                $_view_included = true;
                $_view_included2 = true;
                $href.="&selected=$select_list";

                head();

                // 상단 현황 부분 출력
                include "$dir/setup.php";

                for($i=count($selected)-2;$i>=0;$i--) {
                        $no = $selected[$i];
                        include "view.php";
                }

                // layer 출력
                if($zbLayer) {
                        echo "n<script>".$zbLayer."n</script>";
                        unset($zbLayer);
                }

                foot();

        }


/**********************************************************************************
* Delete_All 일때 (선택된 게시물 삭제)
*********************************************************************************/

        elseif($exec=="delete_all") {

                for ($i=0;$i<count($selected)-1;$i++) {

                        $temp=mysql_fetch_array(mysql_query("select * from $t_board"."_$id where no='$selected[$i]'"));

                        // 답글이 없을때
                        if(!$temp[child]) {

                                // 글삭제
                                mysql_query("delete from $t_board"."_$id where no='$selected[$i]'") or Error(mysql_error());

                                // 카테고리에서 숫자 하나 뺌
                                mysql_query("update $t_category"."_$id set num=num-1 where no='$temp[category]'",$connect);

                                // 파일삭제
                                @z_unlink("./".$temp[file_name1]);
                                @z_unlink("./".$temp[file_name2]);
                @z_unlink("./".$temp[file_name2]);
                @z_unlink("./".$temp[file_name3]);
                @z_unlink("./".$temp[file_name4]);
                @z_unlink("./".$temp[file_name5]);
                @z_unlink("./".$temp[file_name6]);
                @z_unlink("./".$temp[file_name7]);
                @z_unlink("./".$temp[file_name8]);
                @z_unlink("./".$temp[file_name9]);
                @z_unlink("./".$temp[file_name10]);


                                // Divison 정리
                                minus_division($temp[division]);

                                // 이전, 다음글에 대한 정리
                                if($temp[depth]==0) {
                                        // 이전글이 있으면 빈자리 메꿈;;;
                                        if($temp[prev_no]) mysql_query("update $t_board"."_$id set next_no='$temp[next_no]' where next_no='$temp[no]'");
                                        // 다음글이 있으면 빈자리 메꿈;;;
                                        if($temp[next_no]) mysql_query("update $t_board"."_$id set prev_no='$temp[prev_no]' where prev_no='$temp[no]'");
                                } else {
                                        $temp2=mysql_fetch_array(mysql_query("select count(*) from $t_board"."_$id where father='$temp[father]'"));
                                        // 원본글이 있으면 원본글의 자식 글을 없앰;;;
                                        if(!$temp2[0]) mysql_query("update $t_board"."_$id set child='0' where no='$temp[father]'");
                                }
                                mysql_query("delete from $t_comment"."_$id where parent='$selected[$i]'") or Error(mysql_error()); // 코멘트삭제

                                // 메시지 보내는 부분
                                if($notice_user) {
                                        if($temp[ismember]) {
                                                $_to = $temp[ismember];
                                                $_from = $member[no];        
                                                $_subject = stripslashes($temp[name])."'s article(s) was ".$_kind."(ed)";
                                                $_memo = stripslashes($temp[name])." 's writed article(s) "".stripslashes($temp[subject]).""was ".$_kind." (ed) by $member[name] n";
                                                _send_message($_to,$_from,$_subject,$_memo);
                                        }
                                }

                        }  
                }
                $temp=mysql_fetch_array(mysql_query("select count(*) from  $t_board"."_$id",$connect));
                @mysql_query("update $admin_table set total_article='$temp[0]' where name='$id'") or Error(mysql_error());
                echo"<script>opener.window.history.go(0);window.close();</script>";
        }

/**********************************************************************************
* Copy All 일때 (선택된 게시물 이동)
*********************************************************************************/

        elseif($exec=="copy_all"||$exec=="move_all") {

                for($i=0;$i<count($selected)-1;$i++) {
                        $s_data=mysql_fetch_array(mysql_query("select * from $t_board"."_$id where no='$selected[$i]'"));

                        
                        // 답글이 없을때;;
                        if($s_data[arrangenum]==0) {

                                // 원본글을 모두 구함
                                $result=mysql_query("select * from $t_board"."_$id where headnum='$s_data[headnum]' order by arrangenum",$connect) or error(mysql_error());

                                $temp=mysql_fetch_array(mysql_query("select max(division) from $t_division"."_$board_name",$connect));
                                $max_division=$temp[0];
                                $temp=mysql_fetch_array(mysql_query("select max(division) from $t_division"."_$board_name where num>0 and division!='$max_division'",$connect));
                                if(!$temp[0]) $second_division=0; else $second_division=$temp[0];

                             // 이동할 게시판의 최고 headnum을 구함
                                $max_headnum=mysql_fetch_array(mysql_query("select min(headnum) from $t_board"."_$board_name where (division='$max_division' or division='$second_division') and headnum>-2000000000",$connect));
                                if(!$max_headnum[0]) $max_headnum[0]=0;
                                $headnum=$max_headnum[0]-1;
                                
                                // 이동할 게시판의 이전, 이후글을 구함
                                $next_data=mysql_fetch_array(mysql_query("select division,headnum,arrangenum from $t_board"."_$board_name where (division='$max_division' or division='$second_division') and headnum>-2000000000 order by headnum limit 1"));
                                if(!$next_data[0]) $next_data[0]="0";
                                else $next_data=mysql_fetch_array(mysql_query("select no,headnum,division from $t_board"."_$board_name where division='$next_data[division]' and headnum='$next_data[headnum]' and arrangenum='$next_data[arrangenum]'"));

                                $a_category=mysql_fetch_array(mysql_query("select min(no) from $t_category"."_$board_name",$connect));
                                $category=$a_category[0];

                                $next_no=$next_data[no];
                                $father=0;
                                $term_father=0;
                                $root_no=0;

                                // looping 하면서 데이타 입력
                                while($data=mysql_fetch_array($result)) {

                                        if(!is_dir("./data/$board_name")) {
                                                @mkdir("./data/$board_name",0777);
                                        }

                                        // 업로드된 파일이 있을경우 처리 #1                
                                        if($data[s_file_name1]) {
                                                $temp_ext=time();
                                                @mkdir("./data/$board_name/".$temp_ext,0777);
                                                @copy($data[file_name1] , "./data/$board_name/".$temp_ext."/".$data[s_file_name1]);
                                                $data[file_name1]="data/$board_name/".$temp_ext."/".$data[s_file_name1];
                                                @chmod("./".$data[file_name1],0706);
                                                @chmod("./data/$board_name/".$temp_ext,0707);
                                        }
                                        // 업로드된 파일이 있을경우 처리 #2        
                                        if($data[s_file_name2]) {
                                                $temp_ext=time();
                                                @mkdir("./data/$board_name/".$temp_ext,0777);
                                                @copy($data[file_name2] , "./data/$board_name/".$temp_ext."/".$data[s_file_name2]);
                                                $data[file_name2]="data/$board_name/".$temp_ext."/".$data[s_file_name2];
                                                @chmod("./".$data[file_name2],0706);
                                                @chmod("./data/$board_name/".$temp_ext,0707);
                                        }
#3 - #9 까지는 생략했습니다.

                                        // 업로드된 파일이 있을경우 처리 #10        
                                        if($data[s_file_name10]) {
                                                $temp_ext=time();
                                                @mkdir("./data/$board_name/".$temp_ext,0777);
                                                @copy($data[file_name10] , "./data/$board_name/".$temp_ext."/".$data[s_file_name10]);
                                                $data[file_name10]="data/$board_name/".$temp_ext."/".$data[s_file_name10];
                                                @chmod("./".$data[file_name10],0706);
                                                @chmod("./data/$board_name/".$temp_ext,0707);
                                        

                                        $data[name]=addslashes($data[name]);
                                        $data[subject]=addslashes($data[subject]);
                                        $data[memo]=addslashes($data[memo]);
                                        $sitelink1=addslashes($sitelink1);
                                        $sitelink2=addslashes($sitelink2);
                                        $email=addslashes($email);
                                        $homepage=addslashes($homepage);
                                        $division=add_division($board_name);
                                        $data[headnum]=$headnum;
                                        $data[division]=$division;
                                        $data[next_no]=$next_no;
                                        $data[prev_no]=0;
                                        $data[category]=$category;
                                        $data[father]=$data[father]+$term_father;
                                        $data[child]=$data[child]+$term_child;

                                        // 게시물 삭제시 기록 남길 경우
                                        if($notice_bbs) {
                                                $data[memo] .= "n* The text was ".$_kind."(ed) by $member[name] (".date("Y-m-d H:i").")";
                                        }

mysql_query("insert into $t_board"."_$board_name (division,headnum,arrangenum,depth,prev_no,next_no,father,child,ismember,memo,ip,password,name,homepage,email,subject,use_html,reply_mail,category,is_secret,sitelink1,sitelink2,file_name1,file_name2,file_name3,file_name4,file_name5,file_name6,file_name7,file_name8,file_name9,file_name10,s_file_name1,s_file_name2,s_file_name3,s_file_name4,s_file_name5,s_file_name6,s_file_name7,s_file_name8,s_file_name9,s_file_name10,x,y,reg_date,islevel,hit,vote,download1,download2,download3,download4,download5,download6,download7,download8,download9,download10,total_comment) values ('$data[division]','$data[headnum]','$data[arrangenum]','$data[depth]','$data[prev_no]','$data[next_no]','$data[father]','$data[child]','$data[ismember]','$data[memo]','$data[ip]','$data[password]','$data[name]','$data[homepage]','$data[email]','$data[subject]','$data[use_html]','$data[reply_mail]','$data[category]','$data[is_secret]','$data[sitelink1]','$data[sitelink2]','$data[file_name1]','$da[file_name2]','$data[file_name3]','$data[file_name4]','$data[file_name5]','$data[file_name6]','$data[file_name7]','$data[file_name8]','$data[file_name9]','$data[file_name10]','$data[s_file_name1]','$data[s_file_name2]','$data[s_file_name3]','$data[s_file_name4]','$data[s_file_name5]','$data[s_file_name6]','$data[s_file_name7]','$data[s_file_name8]','$data[s_file_name9]','$data[s_file_name10]','$data[x]','$data[y]','$data[reg_date]','$data[islevel]','$data[hit]','$data[vote]','$data[download1]','$data[download2]','$data[download3]','$data[download4]','$data[download5]','$data[download6]','$data[download7]','$data[download8]','$data[download9]','$data[download10]','$data[total_comment]')") or error(mysql_error());

                                        
                                        $no=mysql_insert_id();
                                        if(!$father) {
                                                $root_no=$no;
                                                $father=$no;
                                                $term_father=$data[no]-$no;
                                        }

                                        // Comment 정리
                                        $comment_result=mysql_query("select * from $t_comment"."_$id where parent='$data[no]' order by reg_date",$connect) or error(mysql_error());
                                        while($comment_data=mysql_fetch_array($comment_result)) {
                                                $comment_data[memo]=addslashes($comment_data[memo]);
                                                $comment_data[name]=addslashes($comment_data[name]);
                                                mysql_query("insert into $t_comment"."_$board_name (parent,ismember,name,password,memo,reg_date,ip) values ('$no','$comment_data[ismember]','$comment_data[name]','$comment_data[password]','$comment_data[memo]','$comment_data[reg_date]','$comment_data[ip]')") or error(mysql_error());
                                        }

                                        mysql_query("update $t_category"."_$board_name set num=num+1 where no='$category'",$connect);
                                }
                                $prev_data=mysql_fetch_array(mysql_query("select headnum from $t_board"."_$board_name where headnum>'$headnum' order by headnum limit 1"));
                                mysql_query("update $t_board"."_$board_name set prev_no='$root_no' where headnum='$prev_data[0]'",$connect) or Error(mysql_error());


                                // 메시지 보내는 부분
                                if($notice_user) {
                                        if($s_data[ismember]) {
                                                $_to = $s_data[ismember];
                                                $_from = $member[no];        
                                                $_subject = stripslashes($s_data[name])."'s article(s) was ".$_kind."(ed)";
                                                $_memo = stripslashes($s_data[name])."'s article(s) "".stripslashes($s_data[subject]).""was ".$_kind." (ed) by $member[name]n";
                                                $_memo .= " Move to : zboard.php?id=".$board_name."&no=".$no;
                                                _send_message($_to,$_from,$_subject,$_memo);
                                        }
                                }
                        }
                }
                $total=mysql_fetch_array(mysql_query("select count(*) from $t_board"."_$board_name",$connect));
                mysql_query("update $admin_table set total_article='$total[0]' where name='$board_name'");


                if($exec=="copy_all") {
                        echo"<script> opener.window.history.go(0); window.close(); </script>";
                } elseif($exec=="move_all") {
                        echo" <script> location.href='list_all.php?id=$id&exec=delete_all&selected=$select_list'; </script>";
                        exit;
                }
        }

        //MySQL 종료 /////////////////////////////////////
        if($connect) mysql_close($connect); $connect="";
?>
  • 대류 2005.01.31 15:51
    // 업로드된 파일이 있을경우 처리 #10
    이 부분에서 끝에 } 가 빠진것 같네요
  • 김종우 2005.01.31 22:12
    대류님, 감사합니다. 큰 도움이 되었습니다.

List of Articles
번호 제목 글쓴이 날짜 조회 수
1292 힛트수를 수정하는 법 질문입니다~ 1 홍석주 2003.07.28 1616
1291 흠 .. 글을 쓴다는것...?? 1 베지타 2009.04.13 10846
1290 흑흑.. 도와주세요 ㅜ_ㅜ 2 신디 2003.02.20 4218
1289 훈민정음 아이콘 추가해 주세요... 마이홈 2005.04.23 1549
1288 회원정보록(주소록겸용) 스킨을 쓰고 있는데 3 file 김명숙 2004.12.23 940
1287 회원정보 수정시에... 1 freshwood 2005.02.04 2364
1286 회원정보 관련해서 질문 합니다. 나무 2004.11.14 852
1285 회원의 최근로그인 시각을 알 수 있는 방법에 대해 질문 드려도 될까요? 3 갠대류612 2005.06.20 3296
1284 회원아이콘변경 3 sunnie 2003.02.28 1919
1283 회원사진등록에 관한 질문입니다 1 열매 2005.08.10 5653
1282 회원가입폼에 헤드풋 넣는 방법은? 3 파인애플 2004.07.10 974
1281 회원가입이 갑자기 안되요 1 file 최기태 2004.11.09 805
1280 회원가입시 2 옹이 2005.09.02 4709
1279 회원가입 페이지로 돌리면 라이센스부분의 에러.. 1 시아 2004.10.07 850
1278 회원가입 전에 회원인증에 관한 질문인데여... 2 슈니마토 2004.09.30 808
1277 회원가입 스킨이요~^^ 1 ^^ 2003.10.15 1307
1276 황당 질문 ㅡㅡ; 3 알까 2005.07.03 3429
1275 홈피를 만들었는데 로그인을 해도 안되내여 꼭쩜 냉유~ 1 화야 2004.05.28 1015
1274 홈피 테두리 사이즈는 어케 조정하는지요? 2 정성희 2003.02.05 4244
1273 홈피 제작중..도와주세요....ㅜ.ㅜ(최근게시물 관련...) 3 박세봉 2005.08.25 4453
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 65 Next
/ 65