DB 엑셀로 내려받으려고 합니다.

DB 엑셀로 내려받으려고 합니다.

QA

DB 엑셀로 내려받으려고 합니다.

본문

phpmyadmin 에서

g5_fmail 라는 테이블의 DB를 엑셀파일로 받아보려고합니다. 

그누보드 관리자 페이지에서 엑셀 받아보는게 있긴한데 눌러서 다운을 받으면 내용이 하나도 안나오네요 ㅠㅠ

 


<?
$sub_menu = "600100";
include_once("./_common.php");
auth_check($auth[$sub_menu], "r");


$sql_common = " FROM g5_fmail WHERE 1 ";
if ($sfl && $stx) $sql_common .= " AND INSTR(`".$sfl."`, '".$stx."') ";


$sql="SELECT * ".$sql_common." ORDER BY seq desc ";
$result = sql_query($sql);




$printStr = "<html xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:x=\"urn:schemas-microsoft-com:office:excel\" xmlns=\"http://www.w3.org/TR/REC-html40\">\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html>\n<head>\n<meta http-equiv=Content-Type content=\"text/html; charset=utf-8\">\n<meta name=ProgId content=Excel.Sheet>\n<style id=\"Classeur1_16681_Styles\">\n TD{border-color:silver;mso-number-format:General;}\n</style>\n </head>\n\n<body>\n<div id=\"Classeur1_16681\" align=center x:publishsource=\"Excel\">\n<table x:str border=1 cellpadding=0 cellspacing=0 width=100% style=\"border-collapse:collapse;border-color:silver\">\n";
$printStr .= "<tr>\n<th nowrap style=\"background:lightcyan;color:navy;text-align:center;font-weight:bold;\">번호</th>";
$printStr .= "<th nowrap style=\"background:lightcyan;color:navy;text-align:center;font-weight:bold;\">이름</th>";
$printStr .= "<th nowrap style=\"background:lightcyan;color:navy;text-align:center;font-weight:bold;\">연락처</th>";
$printStr .= "<th nowrap style=\"background:lightcyan;color:navy;text-align:center;font-weight:bold;\">생년월일</th>";
$printStr .= "<th nowrap style=\"background:lightcyan;color:navy;text-align:center;font-weight:bold;\">기대출</th>";
$printStr .= "<th nowrap style=\"background:lightcyan;color:navy;text-align:center;font-weight:bold;\">희망금액</th>";
$printStr .= "<th nowrap style=\"background:lightcyan;color:navy;text-align:center;font-weight:bold;\">대출상품</th>";
$printStr .= "<th nowrap style=\"background:lightcyan;color:navy;text-align:center;font-weight:bold;\">상태</th>";
$printStr .= "<th nowrap style=\"background:lightcyan;color:navy;text-align:center;font-weight:bold;\">아이피</th>";
$printStr .= "<th nowrap style=\"background:lightcyan;color:navy;text-align:center;font-weight:bold;\">접수일</th>";
$printStr .= "</tr>\n";
$i = 1;
while($row = mysql_fetch_array($result)){
	$printStr .= "
		<tr>\n
			<td style=\"mso-number-format:'\#\,\#\#0';text-align:right\" nowrap>".$i."</td>\n
			<td style=\"text-align:center\" nowrap>".$row['name']."</td>\n
			<td style=\"text-align:center\" nowrap>".$row['tel']."</td>\n
			<td style=\"text-align:center\" nowrap>".($row['birth']!='0000-00-00' ? $row['birth']:' ')."</td>\n
			<td style=\"text-align:center\" nowrap>".$row['loan_use']."</td>\n
			<td style=\"text-align:center\" nowrap>".($row['amt']>0 ? number_format($row['amt']).'만원':null)."</td>\n
			<td style=\"text-align:center\" nowrap>".$row['flag']."</td>\n
			<td style=\"text-align:center\" nowrap>".$row['sts']."</td>\n
			<td style=\"text-align:center\" nowrap>".$row['ip']."</td>\n
			<td style=\"mso-number-format:'Short Date';text-align:center\" nowrap>".substr($row['w_dt'],0,10)."</td>\n
		</tr>\n
	";
	$i++;
}
$printStr .= "</table>\n</div>\n</body>\n</html>\n";
$filename = "온라인문의_".date("Y_m_d").".xls";
$filename = preg_replace('/\./', '%2e', $filename, substr_count($filename, '.') - 1);
$filename = iconv("UTF-8", "EUC-KR", $filename);
header("Content-type: application/vnd.ms-excel;charset=utf-8");
header("Content-Length: ".strlen($printStr)); 
header("Content-Disposition: attachment; filename=".$filename);
header("Content-Description: PHP4 Generated Data" );
header("Content-Transfer-Encoding: text/plain");
header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
header("Pragma: no-cache");
header("Expires: 0");
exit($printStr);
?>
 
 
 


이렇게 양식이 있는데 엑셀로 내려받으면 내용은 아무것도 안보이네요... 경로가 잘못된건지

아니면 다른게 문제인지 모르겠습니다. 도와주세요 ㅠ

이 질문에 댓글 쓰기 :

답변 3

48번부터 58번까지를 가장 4번 줄에 넣어서 실행해 보세요. 

걍 왠만 한  서버 업체라면  전하 한통 화하면 해줍니다

서버 업체에서 당연이 해주는거고 해주는 시간도 10분도 안걸리는 일입니다

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

회원로그인

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