엑셀파일로 다운로드받는방법

엑셀파일로 다운로드받는방법

QA

엑셀파일로 다운로드받는방법

본문

그누보드를 사용하는 유저입니다.


게시판리스트에서 해당 글 뷰페이지로 이동하게되면 그내용에 대해서 엑셀로 다운을받고싶은데..어떻해하면좋을까요..?

이 질문에 댓글 쓰기 :

답변 3

<?

ob_start();

include_once($_SERVER['DOCUMENT_ROOT'] ."/common.php");


header("Content-type:application/vnd.ms-excel");

header("Content-Disposition:attachment;filename=view.xls");


$is_title="엑셀 문서 다운로드";


$bo_table=$_GET['bo_table'];

$wr_id=(int)$_GET['wr_id'];



$sql="select * from g5_write_".$bo_table." where wr_is_comment=0 and wr_id='{$wr_id}'";

$is_print=sql_fetch($sql);

?>

<!doctype html>

<html lang="ko">

<head>

<meta charset="UTF-8">

<style type="text/css">

.txt {mso-number-format:'\@'}

</style>

<title><?=$is_title?></title>

</head>

<body>

<table>

<tr>

<th scope="col">번호</th>

<th scope="col">글쓴이</th>

<th scope="col">제목</th>

<th scope="col">글내용</th>

<th scope="col">조회수</th>

<th scope="col">날짜</th>

</tr>

<tr>

<td class='txt'><?=$is_print['wr_id']?></td>

<td class='txt'><?=$is_print['wr_name']?></td>

<td class='txt'><?=$is_print['wr_subject']?></td>

<td class='txt'><?=$is_print['wr_content']?></td>

<td class='txt'><?=$is_print['wr_hit']?></td>

<td class='txt'><?=$is_print['wr_datetime']?></td>

</tr>

</table>

</body>

</html>



위에 소스를 excel_view.php 이름으로 저장후 사용중인 게시판 스킨 폴더안으로 업로드를 합니다. 

게시판 스킨 폴더 > view_skin.php 파일 소스 적당한 자리를 선택후 아래의 링크를 추가해 보세요.


<a href="<?=$board_skin_url?>/excel_view.php?bo_table=<?=$bo_table?>&wr_id=<?=$view['wr_id']?>">엑셀보기</a>

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

회원로그인

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