관리자 페이지 스마트에디터 붙이기 도와주세요 고수님들 ㅠㅠ

2020-01-02 (목) 10:39:00 5,261
Copy
<?php 

$sub_menu = "910100";

define("_PR_ADD_", true);

include_once('./_common.php');

 

auth_check($auth[$sub_menu], 'w');

 

if ($is_admin != 'super')

    alert('최고관리자만 접근 가능합니다.');

 

$g5['title'] = '제품관리';

include_once('./admin.head.php');

include_once(G5_EDITOR_LIB);

 

?>


 

<form action="./aa_product_update.php" method="post" onsubmit="" id="pr_form">

    <div class="tbl_frm01 tbl_wrap">

        <table>

            <caption>제품 정보</caption>

            <tbody>

                <!-- 제품 이름 -->

                <tr>

                    <th scope="row">

                        <label for="pr_name">제품 이름</label>

                    </th>

                    <td>

                        <input type="text" name="pr_name" value="" id="pr_name" required="" class="frm_input  required alnum_" maxlength="20">

                        <!-- 영문자, 숫자, _ 만 가능 (공백없이 20자 이내) -->

                    </td>

                </tr>

    

                <!--  -->

                <tr>

                    <th scope="row">

                        <label for="pr_desc">제품 설명</label>

                    </th>

                    <td>

                        <textarea name="pr_desc" id="pr_desc" cols="30" rows="10"></textarea>

                    </td>

                </tr>

    

                <!--  -->

                <tr>

                    <th scope="row">

                        <label for="pr_spec">제품 특성</label>

                    </th>

                    <td>

                        <?php echo editor_html("pr_spec", get_text("", 0));?>

                    </td>

                </tr>

    

                <!--  -->

                <tr>

                    <th scope="row">

                        <label for="pr_using">제품 주요 사용처</label>

                    </th>

                    <td>

                        <?php echo editor_html("pr_using", get_text("", 0));?>

                    </td>

                </tr>

    

                <!--  -->

                <tr>

                    <th scope="row">

                        <label for="pr_sample">제품 샘플사진</label>

                    </th>

                    <td>

                        <?php echo editor_html("pr_sample", get_text("", 0));?>

                    </td>

                </tr>

    

                <!--  -->

                <tr>

                    <th scope="row">

                        <label for="pr_system">제품 시공 순서</label>

                    </th>

                    <td>

                        <?php echo editor_html("pr_system", get_text("", 0));?>

                    </td>

                </tr>

    

                <!--  -->

                <tr>

                    <th scope="row">

                        <label for="pr_compare">제품 비교</label>

                    </th>

                    <td>

                        <?php echo editor_html("pr_compare", get_text("", 0));?>

                    </td>

                </tr>

            </tbody>

        </table>

    </div>

</form>

이런식으로 작성했으며 데이터 받는 부분은 print_r2로 뿌려주고있는데

(
    [pr_name] => asfs
    [pr_desc] => dfasfsad
    [pr_spec] => 
    [pr_using] => 
    [pr_sample] => 
    [pr_system] => 
    [pr_compare] => 
)

이런식으로 에디터쪽부분에 작성한 부분은 모두 빈값으로 전달되고있습니다.. ㅠㅠ 뭐가 문제인지 잘모르겠습니다 도와주세요 고수님들 ㅠㅠ

답변 2개 / 댓글 2개

2020-01-02 (목) 10:45:07

에디터가 정상적으로 작동한다는 가정하에~

에디터 부분 저장된 값을 불러올라면

<?php echo editor_html("pr_spec", get_text("", 0));?>   

이부분 수정 해야 할듯한데요

get_text 부분에 저장된 값 넣어주셔야 하지 않을가요

그리고 폼 저장할때 

스크립트 부분에  에디터 개수별로

<?php echo get_editor_js("pr_spec"); ?>  있는지 확인 하고요

답변에 대한 댓글 2개

<script>
function fboardform_submit(f)
{
<?php
if(!$w){
$js_array = get_bo_table_banned_word();
echo "var banned_array = ". json_encode($js_array) . ";\n";
}
?>

// 게시판명이 금지된 단어로 되어 있으면
if( (typeof banned_array != 'undefined') && jQuery.inArray(f.bo_table.value, banned_array) !== -1 ){
alert("입력한 게시판 TABLE명을 사용할수 없습니다. 다른 이름으로 입력해 주세요.");
return false;
}

<?php echo get_editor_js("pr_spec"); ?>
<?php echo get_editor_js("pr_using"); ?>
<?php echo get_editor_js("pr_sample"); ?>
<?php echo get_editor_js("pr_system"); ?>
<?php echo get_editor_js("pr_compare"); ?>

if (parseInt(f.bo_count_modify.value) < 0) {
alert("원글 수정 불가 댓글수는 0 이상 입력하셔야 합니다.");
f.bo_count_modify.focus();
return false;
}

if (parseInt(f.bo_count_delete.value) < 1) {
alert("원글 삭제 불가 댓글수는 1 이상 입력하셔야 합니다.");
f.bo_count_delete.focus();
return false;
}

if( captcha_chk ) {
<?php echo isset($captcha_js) ? $captcha_js : ''; // 캡챠 사용시 자바스크립트에서 입력된 캡챠를 검사함 ?>
}

return true;
}
</script>

이렇게 추가했지만 해당 출력부분에서 여전히 출력되지 않았습니다. ㅠㅠ
해결했습니다.

function fboardform_submit(f)
{

<?php echo get_editor_js("pr_spec"); ?>
<?php echo get_editor_js("pr_using"); ?>
<?php echo get_editor_js("pr_sample"); ?>
<?php echo get_editor_js("pr_system"); ?>
<?php echo get_editor_js("pr_compare"); ?>

return true;
}


이거만 적으면 됐었습니다.!!
나머지부분에서 오류가 일어나 적용되지 않았었습니다! 감사합니다!
2020-01-02 (목) 10:44:18

에디터는 보낼때 스크립트로 처리를 해줘야합니다. 해당 부분도 있으신건가요?

없으시면 참고하신곳을 보고 같이 붙여주세요

답변을 작성하려면 로그인이 필요합니다.