generate xls file on fly
| From: | Hiep Nguyen | Date: | Fri, 08 Feb 2008 13:41:16 +0000 |
| Subject: | generate xls file on fly | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-268935@lists.php.net to get a copy of this message | ||
hi friends,
i have a php page with the following logic:
<html>
<head>
<title>Download</title>
</head>
<table>
<tr><td>Title></td><td>Author</td></tr>
<? $sql = "select title,author from book where title != null and author != null"; ?>
<? $rs = mysql_query($sql) or die(mysql_error()); ?>
<? while($row = mysql_fetch_array($rs)) { ?>
<tr><td><?=$row[0];?></td><td><?=$row[1];?></td></tr>
<? } ?>
<tr><td><a href="">Download Into Excel File</a></td></tr>
</table>
</html>
is there anyway to generate this into xls file w/o using fopen & fwrite to the server? my goal is to have a link after the table and user can click on that link and a save window pop up to allow user to save to local disk.
appreciate very much for any input.
t. hiep