scusate se mi intrometto sto anch'io faticando con questo problema io ho fatto questo ho il problema che mi chiede se salvare o aprire come deve fare ma il file è vuoto addirittura in certi casi mi porta dentro tutto quello che trova nella pagina principale quella che ha il link a questa:
$filename="product-nopics.xls"; // nome del file che creeremo
$products_nopics = "select p.products_id, p.products_model, pd.products_name, p.products_image from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
where p.products_id = pd.products_id and pd.language_id='" . $_SESSION['languages_id'] . "' and p.products_model like'". $filtro ."' order by p.products_model";
$nopics=$db->Execute($products_nopics) or die (mysql_error());
?>
<html>
<head>
<title>Export</title>
</head>
<body>
<table border="1">
<tr>
<th>ID#</th>
<th>Codice</th>
<th>Descrizione</th>
</tr>
<?php
header ("Content-Type: application/vnd.ms-excel"); // specifichiamo il Content-Type
header ("Content-Disposition: inline; filename=$filename"); // specifichiamo la risorsa
$conn = mysql_connect('localhost','user','password') or die ('Connessione al Database fallita!!!!!');
mysql_select_db('catalogo',$conn) or die ('Il Database selezionato non esiste !!!');
$sql="SELECT * FROM cat_products";
$query=@mysql_query($sql) or die (mysql_error());
while ($row=mysql_fetch_array($query)) {
$id=$nopics->fields['products_id'];
$model=$nopics->fields['products_model'];
$name=$nopics->fields['products_name'];
?>
<tr>
<td><?php echo $id; '\t'?></td>
<td><?php echo $model;'\t'?></td>
<td><?php echo $name; '\n'?></td>
</tr>
<?php
}
?>
</table>
</body>
</html>