게시판 엑셀 다운로드 코드 ?

게시판 엑셀 다운로드 코드 ?

QA

게시판 엑셀 다운로드 코드 ?

본문

<?
$excel_down =  "g5_write_notice" . $_GET['bo_table']; //엑셀 다운로드 테이블 설정 g5_write 는 기본 그누 세팅시 자동으로 붙습니다.
$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);
//_query("SET CHARACTER SET utf8");  // 한글깨지면 주석해지

if ($ms =="excel"){
$g5[title] = "엑셀 문서 다운로드";
  header( "Content-type: application/vnd.ms-excel" );
  header( "Content-Disposition: attachment; filename=상담신청.xls" );
  //header( "Content-Description: PHP4 Generated Data" );
 } else if ($ms =="power"){
 $g5[title] = "파워포인트 문서 다운로드";
  header( "Content-type: application/vnd.ms-powerpoint" );
  header( "Content-Disposition: attachment; filename=상품구매.ppt" );
  // header( "Content-Description: PHP4 Generated Data" );
 } else if ($ms =="word"){
  $g5[title] = "워드 문서 다운로드";
  header( "Content-type: application/vnd.ms-word" );
  header( "Content-Disposition: attachment; filename=상품구매.doc" );
  //header( "Content-Description: PHP4 Generated Data" );
 } else if ($ms =="memo"){
  $g5[title] = "메모 문서 다운로드";
  header( "Content-type: application/vnd.ms-notepad" );
  header( "Content-Disposition: attachment; filename=상품구매.txt" );
 } else {
  header( "Content-type: application/vnd.ms-excel" );
  header( "Content-Disposition: attachment; filename=상품구매.xls" );
 }
  header( "Content-Description: PHP5 Generated Data" );

 

$temp=mysql_fetch_array(mysql_query("select count(*) from $excel_down where wr_is_comment = '0' and wr_content = '$wr_id' "));
        $result=_query("select * from $excel_down where wr_is_comment = '0'  and wr_content = '$wr_id' order by wr_datetime desc");

      $number=$temp[0]
?>

스킨 게시판 폴더에 excel.php 파일 업로드 하고

 

했는데 뭐가 잘못 되었는지 excel 버튼을 클릭하면 엑셀은 다운 되는데 안에

 

아무것도 출력이 안되네요 어디가 잘못 된걸까요 ㅠ ?

 

https://sir.kr/g4_tiptech/24559

 

위에 링크 보고 작업햇습니다.

이 질문에 댓글 쓰기 :

답변 2


echo "select count(*) from $excel_down where wr_is_comment = '0' and wr_content = '$wr_id' ".'<br />';
echo "select * from $excel_down where wr_is_comment = '0'  and wr_content = '$wr_id' order by wr_datetime desc".'<br />';

echo 로 출력된 부분의 쿼리를 직접 쿼리창(phpadmin 과 같은..)에서 실행해 보세요

쿼리가 잘못되었을 겁니다

 

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

회원로그인

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