Details later,
<?php
if(!empty($_GET['file'])){
$foo = "some value,another value,last value";
file_put_contents("File1.csv",$foo);
@ob_end_clean();
header("Content-type: application/vnd.ms-excel");
header("Content-disposition: attachment; filename=File1.csv");
header("Cache-control: private");
header('Pragma: private');
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
$new_length = filesize("File1.csv");
echo $foo;
}else{
echo "<a href='?file=1'>Click here</a>";
}
?>
<?php
if(!empty($_GET['file'])){
$foo = "some value,another value,last value";
file_put_contents("File1.csv",$foo);
@ob_end_clean();
header("Content-type: application/vnd.ms-excel");
header("Content-disposition: attachment; filename=File1.csv");
header("Cache-control: private");
header('Pragma: private');
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
$new_length = filesize("File1.csv");
echo $foo;
}else{
echo "<a href='?file=1'>Click here</a>";
}
?>