I am exporting to a csv file and it is working fine except, Instead of calling it what i want it called (blah.csv)the file is always called export.php (the name of the php file i'm running)
I am calling export.php from a form on a previous page. an example of the file is below
<?php
header("Content-type: application/x-unknown");
$EXPORT_TIME=time();
header("Content-disposition: attachment;
filename=export$EXPORT_TIME.csv");
include('inc/dbasessi.inc');
$the_query = "SELECT * FROM L2_General Order By Company_Type ASC, Company ASC";
$result=mysql_query( $the_query ) or die ("Cannot make query.");
echo "G_ID\tG_Fname\tG_Sname\n";
while ($row = mysql_fetch_array ($result))
{
echo $row['G_ID'];
echo "\t"; echo $row['G_Fname'];
echo "\t"; echo $row['G_Sname'];
echo "\n";
};
?>
any clues??
Cheers,
Hugh