테스트 사이트 - 개발 중인 베타 버전입니다

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

Romancia 10년 전 조회 6,360

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

 

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

 

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

 

감사합니다. 

댓글을 작성하려면 로그인이 필요합니다.

답변 2개

채택된 답변
+20 포인트
10년 전

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];

?>

                                  

   

                    ";   $number--;   } ?>
20갯수1
$number$data[wr_subject]$data[wr_1]$data[wr_2]

 

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

 

 

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

10년 전

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

답은 나와있네요~ 

 

로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

R
Romancia
10년 전
그대로 하면 되나요?? 안되서... 샘플좀~~~ 부탁드려요.

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인