First example
<?
header("Content-Type: application/vnd.ms-excel");
echo "<table border=1>
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
</tr>
</table>";
?>
Implementation
$header = "Header1" . "\t";
$header .= "Header2" . "\t";
//Reading the data thro' POST
$data= $_POST['header1']. "\t";
$data .= $_POST['header2'] . "\t";
header("Content-type: application/x-msdownload");
header("Content-Disposition: attachment; filename=xyz.xls");
header("Pragma: no-cache");
header("Expires: 0");
print "$header\n$data";



0 comments:
Post a Comment