여분필드로 입력받는 내용 엑셀 다운로드 문의드립니다.
본문
글쓰기 스킨
<?
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');
}
$wr2 = explode("|",$write[wr_2]);
$ex01 = $wr2[0];
$ex02 = $wr2[1];
$ex03 = $wr2[2];
$ex04 = $wr2[3];
$ex05 = $wr2[4];
$ex06 = $wr2[5];
$ex07 = $wr2[6];
$ex08 = $wr2[7];
$ex09 = $wr2[8];
$ex10 = $wr2[9];
$ex11 = $wr2[10];
$ex12 = $wr2[11];
$ex13 = $wr2[12];
$ex14 = $wr2[13];
$ex15 = $wr2[14];
$ex16 = $wr2[15];
$ex17 = $wr2[16];
$ex18 = $wr2[17];
$ex19 = $wr2[18];
$ex20 = $wr2[19];
$ex21 = $wr2[20];
$ex22 = $wr2[21];
$ex23 = $wr2[22];
$ex24 = $wr2[23];
$ex25 = $wr2[24];
$ex26 = $wr2[25];
$ex27 = $wr2[26];
$ex28 = $wr2[27];
$ex29 = $wr2[28];
$ex30 = $wr2[29];
$ex31 = $wr2[30];
$ex32 = $wr2[31];
$ex33 = $wr2[32];
$ex34 = $wr2[33];
$ex35 = $wr2[34];
$ex36 = $wr2[35];
$ex37 = $wr2[36];
$ex38 = $wr2[37];
$ex39 = $wr2[38];
$ex40 = $wr2[39];
?>
<input class="ed" size=8 name=ex01 value="<?=$ex01?>" style="width:100%">
<input class="ed" size=8 name=ex02 value="<?=$ex02?>" style="width:100%">
<input class="ed" size=8 name=ex03 value="<?=$ex03?>" style="width:100%">
위와 같이 여분필드를 쪼개어 입력은 정상적으로 받았습니다.
아래는 엑셀 받기 소스인데요
엑셀을 받으면 여분필드가 보여지지 않습니다.
답변 부탁드리겠습니다.
<?
$excel_down = "g4_write_" . $_GET['bo_table']; //엑셀 다운로드 테이블
$wr_id = $id = $_GET['wr_id'];
$ex_data = explode("|",$row[wr_2]);
include "../../../dbconfig.php";
$db_conn = mysql_connect($mysql_host, $mysql_user, $mysql_password) or die('서버에 접속하지 못했습니다.');
mysql_select_db($mysql_db, $db_conn);
//@mysql_query("SET CHARACTER SET utf8"); // 한글깨지면 주석해지
$today = date("Y-m-d");
header( "Content-type: application/vnd.ms-excel" );
header( "Content-Disposition: attachment; filename=다운로드_". $today. ".xls");
header( "Content-Description: PHP4 Generated Data" );
$temp=mysql_fetch_array(mysql_query("select count(*) from $excel_down ")); //where wr_is_comment = '0' and wr_content = '$wr_id' "));
$result=@mysql_query("select * from $excel_down order by wr_datetime desc");// where wr_is_comment = '0' and wr_content = '$wr_id' order by wr_datetime desc");
$number=$temp[0];
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<style type="text/css">
.txt {mso-number-format:'\@'}
</style>
</head>
<body>
<table border="1">
<tr>
<td>No</td>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
<td>date</td>
</tr>
<?
$wr2 = explode("|",$write[wr_2]);
$ex01 = $wr2[0];
$ex02 = $wr2[1];
$ex03 = $wr2[2];
$ex04 = $wr2[3];
$ex05 = $wr2[4];
$ex06 = $wr2[5];
$ex07 = $wr2[6];
$ex08 = $wr2[7];
$ex09 = $wr2[8];
$ex10 = $wr2[9];
$ex11 = $wr2[10];
$ex12 = $wr2[11];
$ex13 = $wr2[12];
$ex14 = $wr2[13];
$ex15 = $wr2[14];
$ex16 = $wr2[15];
$ex17 = $wr2[16];
$ex18 = $wr2[17];
$ex19 = $wr2[18];
$ex20 = $wr2[19];
$ex21 = $wr2[20];
$ex22 = $wr2[21];
$ex23 = $wr2[22];
$ex24 = $wr2[23];
$ex25 = $wr2[24];
$ex26 = $wr2[25];
$ex27 = $wr2[26];
$ex28 = $wr2[27];
$ex29 = $wr2[28];
$ex30 = $wr2[29];
$ex31 = $wr2[30];
$ex32 = $wr2[31];
$ex33 = $wr2[32];
$ex34 = $wr2[33];
$ex35 = $wr2[34];
$ex36 = $wr2[35];
$ex37 = $wr2[36];
$ex38 = $wr2[37];
$ex39 = $wr2[38];
$ex40 = $wr2[39];
while($data=mysql_fetch_array($result)) {
echo "
<tr>
<td>$number</td>
<td>$data[wr_subject]</td>
<td>$data[wr_name]</td>
<td class='txt'>$data[ex01]</td>
<td class='txt'>$data[ex02]</td>
<td class='txt'>$data[ex03]</td>
<td class='txt'>$data[ex04]</td>
<td class='txt'>$data[ex05]</td>
<td class='txt'>$data[wr_datetime]</td>
</tr>
";
$number--;
}
?>
</table>
</body>
</html>
답변 2
데이타가 $row["wr_2"] 에 저장된 거 같네여.
루프안에서 데이타를 처리해야 할 거 같아요.
아래 참고
=================================================
while($data=mysql_fetch_array($result)) {
$temp = explode("",$data[wr_2]);
$ex01 = $temp[0];
$ex02 = $temp[1];
$ex03 = $temp[2];
...
}
|
78 | echo " |
79 | <tr> |
80 | <td> $number </td> |
81 | |
82 | <td> $data [wr_subject]</td> |
83 | <td> $data [wr_name]</td> |
84 | <td class = 'txt' > $ ex01</td> |
85 | <td class = 'txt' > $ ex02</td> |
86 | <td class = 'txt' > $ ex03</td> |
87 | <td class = 'txt' > $ ex04</td> |
88 | <td class = 'txt' > $ ex05</td> |
89 | <td class = 'txt' > $data [wr_datetime]</td> |
90 | </tr> |
91 | "; |
92 | $number --; |
93 | } |
답변을 작성하시기 전에 로그인 해주세요.