By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,116 Members | 1,097 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,116 IT Pros & Developers. It's quick & easy.

.doc and php

P: n/a
Hi everybody,
i hope s.o. can help me with some advice...
i need to create a MS Word document (.doc, but a .rtf could be ok) by
php, taking data from a mySql database.
Can you help me?

thank you in advance for your help

Fra
--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
Jul 13 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
"Francesco" <fr******@hotmail.comwrote in message
news:38************************************@mygate .mailgate.org...
Hi everybody,
i hope s.o. can help me with some advice...
i need to create a MS Word document (.doc, but a .rtf could be ok) by
php, taking data from a mySql database.
Can you help me?

thank you in advance for your help

doc is pretty damn ugly thing, try the rtf rather. It's ugly as hell too,
but just not as horrible as doc. I've done rtf's so that first I write a
template in Word and save to rtf, then open the rtf as plaintext and just
add php for the magic. Doc isn't anywhere near as friendly as that.

--
"ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" -lpk
sp**@outolempi.net | Gedoon-S @ IRCnet | rot13(xv***@bhgbyrzcv.arg)
Jul 13 '06 #2

P: n/a
thx, good idea...i'll try to do so
Fra
--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
Jul 13 '06 #3

P: n/a
"Francesco" <fr******@hotmail.comwrote in message
news:39************************************@mygate .mailgate.org...
thx, good idea...i'll try to do so
Fra

If you do decide to use rtf, here's some magical lines that you may find
very useful, took me forever to get these right ;)

header('Content-type: application/msword');
header('Content-Disposition: attachment; filename="myfile.rtf"');
header('Cache-Control: private');

--
"ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" -lpk
sp**@outolempi.net | Gedoon-S @ IRCnet | rot13(xv***@bhgbyrzcv.arg)
Jul 13 '06 #4

P: n/a
if someone else is intrested i found a free class you can use to create
..doc files, without using COM.
you can find it here (download require free reg):

http://www.phpclasses.org/browse/package/2631.html

thank you again
fra
--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
Jul 13 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.