게시글 수정 시 새로운 게시물로 업로드

게시글 수정 시 새로운 게시물로 업로드

QA

게시글 수정 시 새로운 게시물로 업로드

본문

안녕하세요 같은거로 여러번 여쭤보네요 죄송합니다..ㅠㅠ

남겨주신 답글 토대로 찾아봤는데 (정말 초짜라) 영 어렵습니다

염치불고하고 다시 왔습니다

 

이게 write_update.php 인데 수정 버튼을 누르면 수정할 수 있도록 해두었습니다

그런데 수정반영 되지않고 자꾸 새로운 게시물로 업로드가 되네요

한번 봐주실 수 있을까요?

특정내용은 지운다고 지웠는데 혹시 보이더라도 무시 부탁드리겠습니다ㅠㅠ..

 

<?

if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

 

 

 

if ($is_dhtml_editor) {

    include_once("$g4[path]/lib/cheditor4.lib.php");

    echo "<script src='$g4[cheditor4_path]/cheditor.js'></script>";

    echo cheditor1('wr_content', '100%', '250');

}

 

$member[mb_id];

 

    include"$_SERVER[DOCUMENT_ROOT]/new_inc/shop_config.php3";

    include"$_SERVER[DOCUMENT_ROOT]/new_inc/new_dbconn.php3";

 

if (!$member[mb_id])

    alert(""));

?>


 

<!-- 20150816 smarteditor -->

<script type="text/javascript" src="/smarteditor2/js/HuskyEZCreator.js" charset="utf-8"></script>

<?

$wr_facilitys = explode("|",$write[wr_facility]); //

$wr_21s = explode("|",$write[wr_21]);

$wr_22s = explode("|",$write[wr_22]); //특징

$wr_23s = explode("|",$write[wr_23]);

?>

<script language="JavaScript">

// 글자수 제한

var char_min = parseInt(<?=$write_min?>); // 최소

var char_max = parseInt(<?=$write_max?>); // 최대

 

$(window).load(function(){

    $('html, body').stop().animate( { scrollTop : 0 }, 600 );

});

 

</script>

 

 <?

        //$sql = " select count(*) as chk from g4_write_pay where buyr_id = '$member[mb_id]' and use_now = 'Y'";

        //$row = sql_fetch($sql);

        //$buy_chk = $row[chk];

        //if ($buy_chk <= 0) {

            //alert(".", "./login.php?$qstr&url=");

        //}

       

    ?>


 

<style>

    .ui-datepicker-calendar { display: none; }

</style>

 

<!--  FF(불여우) 에서는 innerHTML 토지이용계획시 폼이 <table> 아래에 있으면 인식하지 못합니다. -->

<div class="contents write_sell">

<div class="wrap_1300">

 

 

 

<form name="fwrite" method="post"  action="" enctype="multipart/form-data" autocomplete="off">

  <table width="<?=$width?>" class="table_none">

    <input type=hidden name=null><!-- 삭제하지 마십시오. -->

    <input type=hidden name=w        value="">

    <input type=hidden name=bo_table value="<?=$bo_table?>">

    <input type=hidden name=wr_id    value="<?=$wr_id?>">

    <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?>">

    <input type=hidden name=sca      value="<?=$sca?>">

    <input type=hidden name=mb_id id=mb_id value="<?=$write_mb ?>">

    <input type=hidden name=wr_1 id=wr_1 value="<?=$request_type ?>">

    <input type=hidden name=w_table id=w_table value="g4_write_request_board">

    <input type=hidden name=board_wr_id id=board_wr_id value="<?=$board_wr_id ?>">

    <tr>

        <td>

            <table class="table_none">

                <tr>

                    <td>

                        <table class="table_none">

                            <tr>

                                <td>

                                    <table class="table_none">

                  <tr>

                    <td>

                                                   

   

    <table class="tabClass margintop">

        <thead>

   

        </thead>

        <tr class="writer_select" style="<? echo ( $mb_id=='admin') ? 'display:none;' : '' ?>">

            

            <td colspan="3"><?=$write_name ?></td>

        </tr>

        <tr class="writer_select">

          

         

        </tr>

        </table>

    </table>

    <table>

        <tbody>

        <thead>

          

        </thead>

            <tr>

              

                <td colspan="4">

                    <input type="text" class="maemae_class" name="wr_name" value='<?=$write[wr_name]?>' style="text-align: right;padding-right:3px;">

 

                </td>

            </tr>

            <tr>

            

                <td colspan="4">

                    <input type="text" class="maemae_class" name="wr_2" value='<?=$write[wr_2]?>' style="text-align: right;padding-right:3px;">

 

                </td>

            </tr>

            <tr style="display:none">

             

                <td colspan="4">

                    <input type="text" class="maemae_class" name="wr_3" value='<?=$write[wr_3]?>' style="text-align: right;padding-right:3px;">

 

                </td>

            </tr>

            <tr>

             

                <td colspan="4">

                    <input type="text" class="maemae_class" name="wr_4" value='<?=$write[wr_4]?>' style="text-align: right;padding-right:3px;">

                     

                </td>

            </tr>

            <tr>

                

                <td colspan="4">

                    <input type="text" class="maemae_class" name="wr_5" value='<?=$write[wr_5]?>' style="text-align: right;padding-right:3px;">

 

                </td>

            </tr>

        </tbody>

    </table>

    <script>

 

    $("input[name=service]").change(function() {

 

        var value = $(this).val();

        if(value == ""){      

            $("#wr_1").val('bunyang');

            $(".").show();

            $(".").hide();

        }else if(value == ""){

                $("#wr_1").val('');

                $(".").hide();

                $(".").show();

            }

       

        });

    </script>

 

 

    <!-- 상세 정보 -->

    <table class="margintop">

        <thead>

            <th colspan="8"><img src=""></th>

        </thead>

        <tbody>        

            <tr>

            

                <td colspan="8">

                    <textarea id="wr_content" name="wr_content" class="ed" style='width:100%; word-break:break-all;' cols="40" rows="5" itemname="" >  <?=$write[wr_content]?></textarea>

                </td>

            </tr>

          </tbody>

        </table>

 

        <table>

            <thead>

                <th colspan="4"><img src=""></th>

            </thead>

            <tbody>

                <tr>

                   

                    <td>

                        <textarea id="agree_txt" name="agree_txt" style='width:100%;' cols="40" rows="5" itemname="" disabled>

                  </textarea>

                        <input type=checkbox name=ch_agree value=agree id=ch_agree style="display:none"></input>

                        <div class="write_page_btn">

                        <div>

 

                            <?

                                if($w == 'u'){

                                   

                                    ?>

                                       <a href="#" class="finish" id="sub_btn" onclick="javascript:fregister_submit(document.fwrite);">수정</a>

                                       

                                    <?

                                   

                                }else{

                                    ?>

                                        <a href="#" class="finish" id="sub_btn" onclick="javascript:fregister_submit(document.fwrite);">작성 완료</a>

                                    <?

                                }

                            ?>

 

                        </div>

                    </div>

 

                    </td>

                </tr>

            </tbody>

        </table>    

   

 

        </td>

        </tr>        

                </table></td>

              </tr>

          </table></td>

        </tr>

                </table>

            </td>

        </tr>

    </table>

    </form>

 

</div>

</div>

 

<script type="text/javascript">

function fregister_submit()

{

    var f = document.fwrite;

 

    if(!f.wr_name.value){

        alert('');

        f.wr_name.focus();

        return;

    }

 

    if(!f.wr_2.value){

        alert('');

        f.wr_2.focus();

        return;

    }

 

    //if(!f.wr_3.value){

    //  alert('');

    //  f.wr_3.focus();

    //  return;

    //}

 

    var w_val = $("input[name='service']").val();

 

    if(w_val == ""){


 

        }else if(value == ""){

           

 

        }

 

 

    <?  

    if($w == 'u'){?>

        var result = confirm('수정하시겠습니까?');

        if(result) {

        <?

        if ($g4[https_url]){

            echo "f.action = '$g4[https_url]/$g4[bbs]/write_update_r_board.php';";

        }

        else{

            echo "f.action = './write_update_r_board.php';";

        }

            echo "f.submit();";

    ?>}

    <?}else{?>

    var result = confirm('등록하시겠습니까?');

            if(result) {

            <?

            if ($g4[https_url]){

                echo "f.action = '$g4[https_url]/$g4[bbs]/write_update_r_board.php';";

            }

            else{

                echo "f.action = './write_update_r_board.php';";

            }

                echo "f.submit();";

        ?>}

            <?}?>

 

}

 

</script>

 

이 질문에 댓글 쓰기 :

답변 4

<input type=hidden name=w        value="">

를 

<input type=hidden name=w        value="<?php echo $w; ?>">

로 수정해보세요

이번 기회에 그냥 PHP7.X 이상 환경으로 옮기신 후, G5로 업그레이드 하세요.

속도도 빨라지고, 보안도 좋아지고, 문제도 자동으로 해결되고...

1석 3조네요.

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

회원로그인

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