作者chrismaggie (中仔)
看板PHP
標題[請益] 請問php 網頁表格轉存excel問題
時間Sat Aug 16 01:31:11 2008
請教各位高手:
因為目前在製作後台系統~需要使用者使用搜尋功能
顯示所需資料後~另存excel檔案.
假設index.php是資料頁面,按下另存後會前往excel.php
然後excel.php就是會跑出另存檔案的部份
我知道excel.php在檔頭必須加入
header("Content-type:application/vnd.ms-excel");
header("Content-Disposition:filename=".date("Ymd")."-excel.xls");
這樣可以另存檔案~但是我不知道怎麼接收資料庫欄位?
假設index.php有跑出廠商名稱.產品名稱與價格三個欄位
分別是$row_sta_year_month['c_name'],$row_sta_year_month['p_name']和
$row_sta_year_month['price']
而我按下令存檔案時會跑到excel.php
請問要怎麼將表格中的資料正確帶到excel.php呢?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.132.218.94
1F:推 tsangbor :你index.php怎麼取值excel.php等同方式!只是輸出方式 08/16 03:34
2F:→ tsangbor :不同而已! 08/16 03:36