상품정보 액셀(엑셀, exel) 다운로드 소스

상품정보 액셀(엑셀, exel) 다운로드 소스

QA

상품정보 액셀(엑셀, exel) 다운로드 소스

본문

안녕하세요. 상품정보 액셀로 다운받기 파일을 만들려고 하는데요...

 

참고 사이트는 http://devcrunch.tistory.com/109 를 기본으로...

 

어떻게 코딩해야 하는지요.. 아시는 분들 좋은 정보 부탁드립니다. 

 

감사합니다. 

이 질문에 댓글 쓰기 :

답변 2

<?

include_once("./_common.php");
$excel_down = "g4_write_" . $_GET['bo_table']; //엑셀 다운로드 테이블
$wr_id = $id = $_GET['wr_id'];

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");  // 한글깨지면 주석해지


if ($ms =="excel"){
$g4[title] = "엑셀 문서 다운로드";
  header( "Content-type: application/vnd.ms-excel" );
  header( "Content-Disposition: attachment; filename=data.xls" );
  //header( "Content-Description: PHP4 Generated Data" );
 } else if ($ms =="power"){
 $g4[title] = "파워포인트 문서 다운로드";
  header( "Content-type: application/vnd.ms-powerpoint" );
  header( "Content-Disposition: attachment; filename=data.ppt" );
  // header( "Content-Description: PHP4 Generated Data" );
 } else if ($ms =="word"){
  $g4[title] = "워드 문서 다운로드";
  header( "Content-type: application/vnd.ms-word" );
  header( "Content-Disposition: attachment; filename=data.doc" );
  //header( "Content-Description: PHP4 Generated Data" );
 } else if ($ms =="memo"){
  $g4[title] = "메모 문서 다운로드";
  header( "Content-type: application/vnd.ms-notepad" );
  header( "Content-Disposition: attachment; filename=data.txt" );
 } else {
  header( "Content-type: application/vnd.ms-excel" );
  header( "Content-Disposition: attachment; filename=clickmarketing.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=utf-8">
<style type="text/css">

.txt {mso-number-format:'\@'}
</style>
</head>

<body>

<table border="1">
  <tr>
    <td>수</td>
    <td>20<!--<?=number_format($total_count)?>--></td>    <!-- 전체 게시글 수-->
    <td></td>
    <td></td>
    <td>갯수</td> 
    <td>1</td>
   </tr>

<?
while($data=mysql_fetch_array($result)) {
echo "
  <tr>
    <td>$number</td>
    <td class='txt'>$data[wr_subject]</td>
    <td class='txt'>$data[wr_1]</td>
 <td class='txt'></td>
    <td class='txt'>$data[wr_2]</td>
    <td class='txt'></td>
  </tr>
";
  $number--;
  }
?>
</table>
</body>
</html>

 

예제코드입니다. 쿼리나 해당 개수 및 폼등은 맞게끔 수정해야됩니다.

 

 

위 블로그 내용대로 적용하시면 됩니다.

답은 나와있네요~ 

 

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

회원로그인

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