Copy
<?header( "Content-type: application/vnd.ms-excel;charset=KSC5601");header( "Content-Disposition: attachment; filename=list.xls" );header( "Content-Description: PHP4 Generated Data" );include "_common.php";if($_POST['chk_wr_id']) { $in = implode(", ", $_POST['chk_wr_id']); $where = "WHERE wr_id IN($in)";}?><html><body> <table border="1"> <tr> <th>wr_id</th> <th>title</th> </tr><?$que = sql_query("SELECT * FROM g5_write_".$_POST['bo_table']." ".$where." ORDER BY wr_id DESC"); while($row = sql_fetch_array($que)) {?> <tr> <td><?=$row['wr_id']?></td> <td><?=$row['wr_subject']?></td> </tr><?}?></table></body></html>
다운받을때 한글이 계속 깨져서 나옵니다.
아래처럼 하면 한글이 안깨지고 잘 나오는데요..
아무래도 DB에서 불러 올때 파일 캐릭터셋을 변환해줘야 하는데
어느 파일에서 어떤부분에 어떤 소스를 수정해야 할지 모르겠습니다.
UTF-8서버 사용중입니다.
도와주세요 ㅠㅠ
Copy
<?header( "Content-type: application/vnd.ms-excel;charset=KSC5601");header( "Content-Disposition: attachment; filename=list.xls" );header( "Content-Description: PHP4 Generated Data" );?><html><body> <table border="1"> <tr> <td>한글이 안깨지고 잘 나와요</td> </tr></table></body></html>
|
답변 2개
2015-04-06 (월) 19:56:22
ㅅㄷㄴㅅ
2015-03-27 (금) 20:04:56
header( "Content-type: application/vnd.ms-excel;charset=KSC5601");
charset 값이 잘못되었네요. 아래와 같이 바꿔주세요.
header( "Content-type: application/vnd.ms-excel;charset=utf-8");
답변을 작성하려면 로그인이 필요합니다.