con questi headers lo forzi a salvare un excel con il nome REPORT.xls
ovviamente prima di questo codice NON DEVE ESSERCI NIENTE DI OUTPUT.. NEMMENO UNO SPAZIO..Codice PHP:
$nomefile = "REPORT.xls";
header ("Content-Type: application/vnd.ms-excel");
header ("Content-Disposition: inline; filename=$nomefile");
poi ci metti
<html xmlns="urn:schemas-microsoft-com
ffice
ffice" xmlns:x="urn:schemas-microsoft-com
ffice:excel" xmlns="http://www.w3.org/TR/REC-html40">
e poi la tua pagina HTML/php.. anche con tabelle.. anzi forse meglio con tabelle..
ho notato che office 2007 su windows 7 riconosce che questo NON è un xls "nativo" e chiede se vuoi aprire con excel o con un altro software..![]()