Try this:
?php
$fileextension=csv;
$filename=report;
$fnsave = $filename.$fileextension;
header(Content-disposition: filename=$fnsave);
header(Content-type: application/force-download);
// generate your CSV content here and print them to the browser via ECHO
echo 'a,b,c,d,1';
It didn'ti work ;-(
Just showed a page with the data in!
How would I do it with a file in any case?
Henry
Lallous [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Try this:
?php
$fileextension=csv;
$filename=report;
$fnsave = $filename.$fileextension;
try making the generated csv file an attachment to the php file... like
so...
?php
$fileextension=csv;
$filename=report;
$fnsave = $filename.$fileextension;
header(Content-type: application/force-download);
header(Content-disposition: attachment; filename=$fnsave);
echo '1,2,3,4,5,6,7,8';
?
Henry wrote:
It didn'ti work ;-(
Just showed a page with the data in!
How would I do it with a file in any case?
You can give the PHP script the extension .csv and use AddType
application/x-httpd-php .csv to your httpd.conf or .htaccess file.
If you want to use a temporary file, you
4 matches
Mail list logo