Reading excel table into PHP

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I'm trying to make a web page that will read the xls file and make a
table out of it on the web page. I want to change the excel file from
time to time and I want the changes to be updated on the website
dynamically. If  it is possible to do it by writing a few lines of
codes into the php file to make it read the data in the xls into the
web page, how can it be done?

If not, what would be the best way to do it?


Re: Reading excel table into PHP

On 5 Mar, 04:41, wrote:

Quoted text here. Click to load it

Easy way:

* Use a Windows server

* Install Excel (cost!) on this server

* Write server-side web code that uses COM (M$oft technology, pretty
easy) to access Excel as a COM component.

** Use Windows web scripting tools (IIS / JScript) to do this COM work
(very easy)

** Use PHP and a COM bridge module to access COM work (not quite so

* Use the web scripting language to generate a HTML table.

I would _NOT_ do this. It needs an Excel licence (expensive), it needs
Excel installed in the back-end (security risk) and it needs Windows
running on a server. However it is very easy to do, especially if
you're already a M$oft shop.

Allternatively I would write some VBA _within_ Excel to dump the XLS
content out as XML  (Maybe even as XHTML).  I would run this Excel
macro on my desktop, and it would upload the resulting file to a
fileserver or ftp server that could be accessed by the web server
(which could now be pure LAMP, with no Windows)

If I wanted sophistication, the web server would then run an XSLT
transform on this result, to make the page look exactly how I wanted

I would also _NOT_ try to use any non-M$oft product that accessed
Excel file formats directly. M$oft Office file formats are proprietary
and unstable. Building tools that depend on them keeping the same
format over time is just asking for trouble.

Re: Reading excel table into PHP wrote:
Quoted text here. Click to load it
Do not use PHP but Perl and module Spreadsheet::ParseExcel or other module
from Spreadsheet family.

Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your
mail from another non-spammer site please.)

Please reply to <petr AT practisoft DOT cz>

Site Timeline