Hi
I got this info from
http://forums.dreamincode.net/showtopic10131.htm
and it works ok with saving the file on the server
but when I use the
'2 - To create the file for the user to download'
the file always starts with three blank lines and
then the data, when opened with spreadsheet, text
editor, or pager.
I have tried both ways and the only real change is
the addition of the 'header(...)' lines. Any ideas
how to stop the header(...) lines from spitting
out newlines?
The second header line is one line.
<?php
header('Content-type: application/octet-stream');
header('Content-Disposition: attachment;
filename="filename.csv"');
header('Pragma: no-cache');
header('Expires: 0');
snip..
echo $data;
?>