Illegal string offset 질문드립니다 ~

Illegal string offset 질문드립니다 ~

QA

Illegal string offset 질문드립니다 ~

본문

Warning: Illegal string offset 'path' in /host/home5/treaz/html/skin/board/shopping1/write.skin.php on line 177 글쓰기누르면  이렇게  뜨구요~ 177라인이 

  $file_path = $file[$i]['path']."/".$file[$i][file];//이미지의 경로  

요곤데 뭐가 잘못된걸까요? 전체소스는

 

write.skin.php

 

 

<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<style>
/* 이 내용은 <head> 안으로 옮기시길 권장합니다. */
#rankiss_w_title {position:relative;margin:0 0 10px;padding:14px 0 0;height:28px;text-align:center;font-weight:bold;font-size:1em; background:url('<?=$board_skin_url?>/img/board_listC.gif') repeat-x}
#rankiss_w_titlel {position:absolute;top:0;left:0;width:8px;height:42px;background:url('<?=$board_skin_url?>/img/board_listL.gif') repeat-x}
#rankiss_w_titler {position:absolute;top:0;right:0;width:8px;height:42px;background:url('<?=$board_skin_url?>/img/board_listR.gif') repeat-x}
.rankiss_write_head {width:120px;height:30px;text-align:center; font-size:11px; font-family:돋움; font-weight:bold; color:#666; letter-spacing:-1px}
.rankiss_write_head1 {width:120px;height:30px;text-align:right; color:#444444;padding:0 7px 0 0}
.rankiss_field {border:1px solid #ccc}
.rankiss_oimg {margin:10px 0 0;width:600px/* IE 에서 table 내 요소에 max-width 를 사용하려면 부모의 넓이를 지정해줘야 합니다. - 지운아빠 2013-05-16 */}
.rankiss_oimg img {max-width:100% !important}
</style>
<h1 id="rankiss_w_title"><span id="rankiss_w_titlel"></span><span id="rankiss_w_titler"></span><?=$g4['title']?></h1>
<form name="fwrite" id="fwrite" action="<?=$action_url?>" onsubmit="return fwrite_submit(this);" method="post" enctype="multipart/form-data" autocomplete="off" style="width:<?=$width;?>">
<input type="hidden" name="w" value="<?=$w?>">
<input type="hidden" name="bo_table" value="<?=$bo_table?>">
<input type="hidden" name="wr_id" value="<?=$wr_id?>">
<input type="hidden" name="sca" value="<?=$sca?>">
<input type="hidden" name="sfl" value="<?=$sfl?>">
<input type="hidden" name="stx" value="<?=$stx?>">
<input type="hidden" name="spt" value="<?=$spt?>">
<input type="hidden" name="sst" value="<?=$sst?>">
<input type="hidden" name="sod" value="<?=$sod?>">
<input type="hidden" name="page" value="<?=$page?>">
<?
$option = '';
$option_hidden = '';
if ($is_notice || $is_html || $is_secret || $is_mail) {
    $option = '';
    if ($is_notice) {
        $option .= "\n".'<input type="checkbox" id="notice" name="notice" value="1" '.$notice_checked.'>'."\n".'<label for="notice">공지</label>';
    }
    if ($is_html) {
        if ($is_dhtml_editor) {
            $option_hidden .= '<input type="hidden" value="html1" name="html">';
        } else {
            $option .= "\n".'<input type="checkbox" id="html" name="html" onclick="html_auto_br(this);" value="'.$html_value.'" '.$html_checked.'>'."\n".'<label for="html">html</label>';
        }
    }
    if ($is_secret) {
        if ($is_admin || $is_secret==1) {
            $option .= "\n".'<input type="checkbox" id="secret" name="secret" value="secret" '.$secret_checked.'>'."\n".'<label for="secret">비밀글</label>';
        } else {
            $option_hidden .= '<input type="hidden" name="secret" value="secret">';
        }
    }
    if ($is_mail) {
        $option .= "\n".'<input type="checkbox" id="mail" name="mail" value="mail" '.$recv_email_checked.'>'."\n".'<label for="mail">답변메일받기</label>';
    }
}
echo $option_hidden;
?>
<table class="frm_tbl" style="width:100%;background:white;">
<tbody>
<? if ($is_name) { ?>
<tr>
    <th scope="row"><label for="wr_name">이름</label></th>
    <td><input type="text" name="wr_name" value="<?=$name?>" id="wr_name" required class="frm_input required" maxlength="20" size="15"></td>
</tr>
<? } ?>
<? if ($is_password) { ?>
<tr>
    <th scope="row"><label for="wr_password">패스워드</label></th>
    <td><input type="password" name="wr_password" id="wr_password" <?=$password_required?> class="frm_input <?=$password_required?>" maxlength="20" size="15"></td>
</tr>
<? } ?>
<? if ($is_email) { ?>
<tr>
    <th scope="row"><label for="wr_email">이메일</label></th>
    <td><input type="text" name="wr_email" value="<?=$email?>" id="wr_email" class="frm_input email" maxlength="100" size="50"></td>
</tr>
<? } ?>
<? if ($is_homepage) { ?>
<tr>
    <th scope="row"><label for="wr_homepage">홈페이지</label></th>
    <td><input type="text" name="wr_homepage" value="<?=$homepage?>" id="wr_homepage" class="frm_input" size="50"></td>
</tr>
<? } ?>
<? if ($option) { ?>
<tr>
    <th scope="row">옵션</th>
    <td><?=$option?></td>
</tr>
<? } ?>
<? if ($is_category) { ?>
<tr>
    <th scope="row"><label for="ca_name">분류</label></th>
    <td>
        <select name="ca_name" id="ca_name" required class="required" >
            <option value="">선택하세요</option>
            <?=$category_option?>
        </select>
    </td>
</tr>
<? } ?>
<tr>
    <th scope="row"><label for="wr_subject">제품명</label></th>
    <td><input name="wr_subject" value="<?=$subject?>" id="wr_subject" required class="frm_input full_input required"></td>
</tr>
<tr>
    <th scope="row"><label for="wr_1" >생산기업</label></th>
    <td><input name="wr_1" value="<?=$write['wr_1']?>" id="wr_1" required class="frm_input full_input required"></td>
</tr>
<tr>
    <th scope="row"><label for="wr_2">가격</label></th>
    <td>
        <input name="wr_2" value="<?=$write['wr_2']?>" id="wr_2" class="frm_input full_input required">
    </td>
</tr>
<tr>
   <th scope="row"><label for="wr_6">상품특징</label></th>
    <td>
        <input name="wr_6" value="<?=$write['wr_6']?>" id="wr_6" class="frm_input full_input required">
    </td>
</tr>
<tr>
    <th scope="row"><label for="wr_3">상품구성</label></th>
    <td>
        <input name="wr_3" value="<?=$write['wr_3']?>" id="wr_3" class="frm_input full_input required">
    </td>
</tr>
<tr>
    <th scope="row"><label for="wr_4">주문전화</label></th>
    <td>
        <input name="wr_4" value="<?=$write['wr_4']?>" id="wr_4" class="frm_input full_input required">
    </td>
</tr>
<tr>
    <th scope="row"><label for="wr_5">판매형태</label></th>
    <td>
        <input name="wr_5" value="<?=$write['wr_5']?>" id="wr_5" class="frm_input full_input required">
    </td>
</tr>
<tr>
    <th scope="row">제품설명</th>
    <td><!-- wr_content --><? echo $editor_html; // 에디터 사용시는 에디터로, 아니면 textarea 로 노출 ?></td>
</tr>
<? for ($i=1; $is_link && $i<=G4_LINK_COUNT; $i++) { ?>
<tr>
    <th scope="row"><label for="wr_link<?=$i?>">링크 #<?=$i?></label></th>
    <td><input type="text" name="wr_link<?=$i?>" value="<?if($w=="u"){echo$write['wr_link'.$i];}?>" id="wr_link<?=$i?>" class="frm_input" size="50"></td>
</tr>
<? } ?>
<? if ($board['bo_related']) { ?>
<tr>
    <th scope="row"><label for="wr_related">관련글</label></th>
    <td>
        <span class="frm_info">예 : 키워드1, 키워드2, 키워드3 / 콤마로 분류</span>
        <input type="text" name="wr_related" value="<?=$write['wr_related']?>" id="wr_related" class="frm_input" size="60">
    </td>
</tr>
<? } ?>
<? for ($i=0; $is_file && $i<$file_count; $i++) {
    $file_path = $file[$i]['path']."/".$file[$i][file];//이미지의 경로 
?>
<tr>
    <th scope="row">제품사진 #<?=$i+1?></th>
    <td>
        <input type="file" name="bf_file[]" title="파일첨부 <?=$i+1?> :  용량 <?=$upload_max_filesize?> 이하만 업로드 가능" class="frm_file frm_input">
        <? if ($is_file_content) { ?>
        <input type="text" name="bf_content[]" value="<? echo $file[$i]['bf_content']; ?>" title="파일 설명을 입력해주세요." class="frm_file frm_input" size="50">
        <? } ?>
        <? if($w == 'u' && $file[$i]['file']) { ?>
        <input type="checkbox" id="bf_file_del<?=$i?>" name="bf_file_del[<? echo $i; ?>]" value="1"> <label for="bf_file_del<?=$i?>"><? echo $file[$i]['source'].'('.$file[$i]['size'].')'; ?> 파일 삭제</label>
        <div class="rankiss_oimg">
            <a href="<?php echo G4_BBS_URL; ?>/view_image.php?fn=<?php echo $bo_table.'/'.urlencode($file[$i][file]); ?>" target="_blank"><img src="<?php echo $file_path; ?>" alt="<?php echo $file[$i]['source']; ?>"></a>
        </div>
        <? } ?>
    </td>
</tr>
<? } ?>
<? if ($is_guest) { ?>
<tr>
    <th scope="row">자동등록방지</th>
    <td>
        <?=$captcha_html?>
    </td>
</tr>
<? } ?>
</tbody>
</table>
<div class="btn_confirm">
    <p>
       작성하신 내용을 제출하시려면 <strong>작성완료</strong> 버튼을, 작성을 취소하고 목록으로 돌아가시려면 <strong>목록보기</strong> 링크를 누르세요.
    </p>
    <input type="image" src="<?=$board_skin_url?>/img/btn_write_save.gif" alt="작성완료" id="btn_submit" accesskey="s">
    <a href="./board.php?bo_table=<?=$bo_table?>"><img id="btn_list" src="<?=$board_skin_url?>/img/btn_write_list.gif" alt="목록보기"></a>
</div>
</form>
<script>
// 이미지 등비율 리사이징
$(window).load(function() {
    view_image_resize();
});
var now = new Date();
var timeout = false;
var millisec = 200;
var tid;
$(window).resize(function() {
    now = new Date();
    if (timeout === false) {
        timeout = true;
        if(tid != null)
            clearTimeout(tid);
        tid = setTimeout(resize_check, millisec);
    }
});
function resize_check() {
    if (new Date() - now < millisec) {
        if(tid != null)
            clearTimeout(tid);
        tid = setTimeout(resize_check, millisec);
    } else {
        timeout = false;
        view_image_resize();
    }
}
$(function() {
    $(".view_image").click(function() {
        window.open(this.href, "large_image", "location=yes,links=no,toolbar=no,top=10,left=10,width=10,height=10,resizable=yes,scrollbars=no,status=no");
        return false;
    });
});
function view_image_resize()
{
    var $img = $(".rankiss_oimg img");
    var img_wrap = $(".rankiss_oimg").width();
    var win_width = $(window).width() - 35;
    var res_width = 0;
    if(img_wrap < win_width)
        res_width = img_wrap;
    else
        res_width = win_width;
    $img.each(function() {
        var img_width = $(this).width();
        var img_height = $(this).height();
        var this_width = $(this).data("width");
        var this_height = $(this).data("height");
        if(this_width == undefined) {
            $(this).data("width", img_width); // 원래 이미지 사이즈
            $(this).data("height", img_height);
            this_width = img_width;
            this_height = img_height;
        }
        if(this_width > res_width) {
            $(this).width(res_width);
            var res_height = Math.round(res_width * $(this).data("height") / $(this).data("width"));
            $(this).height(res_height);
        } else {
            $(this).width(this_width);
            $(this).height(this_height);
        }
    });
}
<?
// 관리자라면 분류 선택에 '공지' 옵션을 추가함
if ($is_admin)
{
    echo '
    if (ca_name_select = document.getElementById("ca_name")) {
        ca_name_select.options.length += 1;
        ca_name_select.options[ca_name_select.options.length-1].value = "공지";
        ca_name_select.options[ca_name_select.options.length-1].text = "공지";
    }';
}
?>
function html_auto_br(obj)
{
    if (obj.checked) {
        result = confirm("자동 줄바꿈을 하시겠습니까?\n\n자동 줄바꿈은 게시물 내용중 줄바뀐 곳을<br>태그로 변환하는 기능입니다.");
        if (result)
            obj.value = "html2";
        else
            obj.value = "html1";
    }
    else
        obj.value = "";
}
function fwrite_submit(f)
{
    <? echo $editor_js; // 에디터 사용시 자바스크립트에서 내용을 폼필드로 넣어주며 내용이 입력되었는지 검사함  ?>
    var subject = "";
    var content = "";
    $.ajax({
        url: g4_bbs_url+"/filter.ajax.php",
        type: "POST",
        data: {
            "subject": f.wr_subject.value,
            "content": f.wr_content.value
        },
        dataType: "json",
        async: false,
        cache: false,
        success: function(data, textStatus) {
            subject = data.subject;
            content = data.content;
        }
    });
    if (subject) {
        alert("제목에 금지단어('"+subject+"')가 포함되어있습니다");
        f.wr_subject.focus();
        return false;
    }
    if (content) {
        alert("내용에 금지단어('"+content+"')가 포함되어있습니다");
        if (typeof(ed_wr_content) != "undefined")
            ed_wr_content.returnFalse();
        else
            f.wr_content.focus();
        return false;
    }
    <? echo $captcha_js; // 캡챠 사용시 자바스크립트에서 입력된 캡챠를 검사함 ?>
    return true;
}
</script>

 

입니다 ㅜㅜ 2일째 밤새며 머리굴려보곤있는데 도저히 모르겠습니다.

이 질문에 댓글 쓰기 :

답변 2

될지는 모르겠습니다만.

 $file_path $file[$i]['path']."/".$file[$i][file]를

아래와 같이

$file_path $file[$i]['path']."/".$file[$i]['file'];

 

바꿔보세요

저도 같은 증상입니다 해결하시었는지요?

물론 그냥 무시하고 글쓰기를 하면 글은 써집니다

답변을 작성하시기 전에 로그인 해주세요.
전체 0 | RSS
QA 내용 검색
  • 개별 목록 구성 제목 답변작성자조회작성일
  • 질문이 없습니다.

회원로그인

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