추가여분필드 문의드려요

매출이 오르면 내리는 수수료! 지금 수수료센터에서 전자결제(PG)수수료 비교견적 신청해 보세요!
추가여분필드 문의드려요

QA

추가여분필드 문의드려요

본문

추가여분필드를 에디터로 변경하여 사용하고있는데요

write페이지에서 파일추가부분에 for문 돌려서 에디터도 파일추가한 갯수만큼 생성되었는데

에디터안에 내용이 출력이 안되네요

<?php echo editor_html("wr_1", $write['wr_1'], $is_dhtml_editor); ?>

이 부분을 

<?php echo editor_html("wr_$i", $write['wr_$i'], $is_dhtml_editor); ?>

로 변경해서 사용하려고 하는데 안되는데 다른방법이 있을까요..?

이 질문에 댓글 쓰기 :

답변 2

https://sir.kr/g5_tip/3411

참고하세요

이거보구 참조한건데요
        <?php for ($i=0; $is_file && $i<$file_count; $i++) { ?>
        <tr>
            <th scope="row">파일<?php echo $i+1 ?></th>
            <td>
                <input type="file" name="bf_file[]" title="파일첨부 <?php echo $i+1 ?> :  용량 <?php echo $upload_max_filesize ?> 이하만 업로드 가능" class="frm_file frm_input">
                <?php if ($is_file_content) { ?>
                <input type="text" name="bf_content[]" value="<?php echo ($w == 'u') ? $file[$i]['bf_content'] : ''; ?>" title="파일 설명을 입력해주세요." class="frm_file frm_input" size="50">
                <?php } ?>
                <?php if($w == 'u' && $file[$i]['file']+1) { ?>
                <input type="checkbox" id="bf_file_del<?php echo $i ?>" name="bf_file_del[<?php echo $i;  ?>]" value="1"> <label for="bf_file_del<?php echo $i ?>"><?php echo $file[$i]['source'].'('.$file[$i]['size'].')';  ?> 파일 삭제</label>
                <?php } ?>
            </td>
<td><label for="" style="width:100px; height:150"><?php echo $file[$i]['view']; ?></label></td>
        </tr>

<tr>
<th scope="row"><label for="wr_<?php echo $i;?>">에디터<?php echo $i+1 ?></label></th>
<td class="wr_content"><?php echo editor_html("wr_1", $write['wr_1'], $is_dhtml_editor); ?></td>
<td></td>
</tr>

        <?php } ?>
위에 질문처럼 for문안에 파일추가 사이에 넣은거라..
wr_1로 하면 나오는데 제가 하고싶은 방법은 wr_$i인데.. 이 $i가 안먹어서요..다른방법이 있을까해서요

정말 무식한 방법으로 해결했습니다ㅠㅠ

for문안에

<?

$tmp = "wr_";

$tmp2 = $i+1;

$tmp3 =  $tmp."". $tmp2;

?>

이렇게 선언해주고

에디터 출력시 

<tr> 

<th scope="row"><label for="<?$tmp3?>">에디터<?php echo $i+1 ?></label></th> 

<td class="wr_content"><?php echo editor_html($tmp3, $write[$tmp3], $is_dhtml_editor); ?></td> 

<td></td>

</tr>

이렇게 해줬더니 나오네요ㅠㅠ

답변을 작성하시기 전에 로그인 해주세요.
전체 60,138
QA 내용 검색

회원로그인

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