codice:
<?php$nomefile="Newsletter.xls";
header ("Content-Type: application/vnd.ms-excel");
header("Content-Disposition:inline; filename=$nomefile");
?>
<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang=it>
<head></head>
<body>
<table border="1">
<tr>
<td>Nome</td>
<td>Email</td>
</tr>


<?php


require "moduli/configtest.php";
require "moduli/connecttest.php";


$query= 'SELECT * FROM Newsletter ';
$result=mysql_query($query);
if ($query==FALSE) die("errore nella composizione della query");
mysql_close($link);
while($row=mysql_fetch_array($result)) 
{
$Nome=$row['Nome'];
$Email=$row['email'];
echo'<tr>';
echo'<td>'.$Nome.'</td>';
echo'<td>'.$Email.'</td>';
echo'</tr>';
}
?>
</table>
</body>
</html>
Ho modificato un po il codice:
se tolgo lo script di esportazione , mi cicla tranquillamente la tabella
se lascio lo script d esportazione in excel, scrive solamente le intestazioni colonna che sono fuori dai tag php. non riesco a capire che passaggio manchi per dargli l input a scrivere