generating word and excel in php

I'm working on a projekt.
I have to do an application in php.
It is supposed to be like this:

I have a php web site.In that web site i have a large textbox or message text area.
When I fill the textbox or the message text area with any data, the php site, by clicking the submit button is supposed to generate a word or excel document with dynamic data. :S Then I'll have another button named "Downoload" so I can download the generated word or excel .doc and view it on my PC.

I'll wait for your answer.
Or you can reply on my e-mail [email removed]

You can generate these files using Headers. This pretty simple module packages it together for various output formats. You need to generate the formatted output in HTML. Word and other programs can take that HTML input and then use it as if it was the native Excel or Word format.