ajax 한글꺠짐

ajax 한글꺠짐

QA

ajax 한글꺠짐

본문

전송페이지


<?
include    "../include/db_connect.html";    $DB = new DB_Connect();
include    "../include/Config.html";
?>
<meta charset="euc-kr">
<script type="text/javascript" src="http://wdreamdc.com/js/jquery-1.8.3.min.js"></script>
<div class="adressWrap">
        <select name="wr_4" class="y1" id="selectID">
        <option value="" required>-선택-</option>
<!-- 사용할데이터 불러오기 -->
        <?
        $addr_sql       = "select * from table where cate2_code='00' and cate3_code='00'  order by snum asc";
        $addr_result    = $DB->dbResult($addr_sql);
        while($addr_row = mysql_fetch_array($addr_result[result])){?>
            <option value="<?=$addr_row[cate1_code]?>"><?=$addr_row[cate_name]?></option>
        <?}?>
        </select>
        <select name="wr_6" class="y2" id="selectID2" required>
        </select>
</div>
<script>
$(document).ready(function(){
        $('#selectID').on('change', function(){ 
                        var path  = window.location.href;
                        // alert(path+"theme/basic/ajaxPHP.php");
                        $.post("./ta.php",{optVal:this.value}, 
                            function(data) {
                                $('#selectID2').empty();
                                $('#selectID2').append('<option value="">-선택-</option>');
                                $('#selectID2').append(data);
                        });
        });
});
</script>

 

받는페이지

 


<meta charset="euc-kr">
<?
include    "../include/db_connect.html";    $DB = new DB_Connect();
include    "../include/Config.html";
$ajax = $_POST['optVal'];
$option="";

$sql="select * from table where cate1_code='".$ajax."' and cate2_code<>'00' and cate3_code='00'";
echo $sql;
// echo $sql;
        $result    = $DB->dbResult($sql);

while ($row = mysql_fetch_array($result[result]))
{
    // echo $row['co_gu'];
    $option=$option.'<option value="'.$row['cate1_code'].'">'.$row['cate_name'].'</option>';
}
echo $option;
?>

 

서버환경은 euc-kr 이고 메타 셋줘도 

 

1차는 한글이 안깨지는데 전송하고 나오는 2차는 한글이깨지는데 어디 수정을 해야 안깨질까요?

이 질문에 댓글 쓰기 :

답변 2

<meta charset="euc-kr">

빼시고,

<?php
header('Content-Type: text/html; charset=utf-8');

끝에서

echo iconv("UTF-8", "ISO-8859-1", $option);

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

회원로그인

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