Salve a tutti ho trovato un semplice esempio di come scrivere un file excel da php. Ma vorrei creare questo file in una cartella specifica.. se faccio $filename="stat/sheet.xls" o anche a metterci il percorso ma non va.. come posso risolvere? se no mi genera 1000 file excel sul desktop e non va bene per quello che dovrò fare poi.. grazie
ecco il codice semplice
<?php
$filename="stat/sheet.xls";
header ("Content-Type: application/vnd.ms-excel");
header ("Content-Disposition: inline; filename=$filename");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang=it><head>
<title>Titolo</title></head>
<body>
<table border="1">
<?php
for ($i=1;$i < 11; $i++)
{
echo "<tr>";
for ($j=1; $j<11;$j++)
{
$a = $i * $j;
echo "<td>$a</td>";
}
echo "</tr>";
}
?>
</table>
</body></html>