View Single Post
  #8 (permalink)  
Old 07-12-05, 06:09 AM
bannme bannme is offline
Newbie Coder
 
Join Date: Jun 2005
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
I donno this one is what you want or not, I get is from
Code:
http://www.weberdev.com/get_example-3701.html
Quote:
So you want to allow your users to get some data directly into their excel.... no problem.

All you need to do it organize your data in rows where each data field is delimited by a comma or
some other acceptable delimiter and send the correct header to the browser.

Suppose you want to send something like :

Car Type Car Model Number of Cars
Mazda 323 5
Mazda 6 4
Mazda MPV 6


all you need to do is :
PHP Code:

<? 

header 
("Content-type: application/csv\nContent-Disposition: \"inline; filename=Report.csv\""); 
Echo
"Car Type,Car Model,Number of Cars\n"
Echo
"Mazda,323,5\n"
Echo
"Mazda,6,4\n"
Echo
"Mazda,MPV,6\n"
?>
I recommand that you better check out their site