Current location: Hot Scripts Forums » Programming Languages » PHP » PHP variables to microsoft word


PHP variables to microsoft word

Reply
  #1 (permalink)  
Old 12-14-07, 07:24 AM
Deansatch Deansatch is offline
Coding Addict
 
Join Date: Jul 2006
Location: Northumberland
Posts: 375
Thanks: 0
Thanked 0 Times in 0 Posts
PHP variables to microsoft word

Does anyone know if it is possible to have users input text and/or images via a php mysql driven site, then for me to export the data to a pre-formatted word document.

e.g. I set up a word document as a template with fancy images and text. The users can submit their name and photos etc... on my website and I login and export to word. The set text in word changes to their details accordingly and the photos to their photos, keeping the layout, font styles and colours.

Is this a possibility or would I have to try and set up web pages that look like the word documents and print them off from the browser???
__________________
Aye!
Reply With Quote
  #2 (permalink)  
Old 12-14-07, 07:39 AM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
Here's a class that might help. It needs a windows server and PHP 5 though.

http://www.phpclasses.org/browse/package/3553.html
Reply With Quote
  #3 (permalink)  
Old 12-15-07, 03:50 AM
job0107's Avatar
job0107 job0107 is offline
Community Liaison
 
Join Date: Dec 2006
Location: Tacoma, Washington USA
Posts: 3,454
Thanks: 0
Thanked 140 Times in 137 Posts
This site explains how to create a ms word document on the fly using a predefined word template.

http://www.phpbuilder.com/columns/yunus20031124.php3
__________________
Jerry Broughton
Reply With Quote
  #4 (permalink)  
Old 12-15-07, 08:11 AM
Deansatch Deansatch is offline
Coding Addict
 
Join Date: Jul 2006
Location: Northumberland
Posts: 375
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks for the links. When I try and run a script I get the following mesage:
"microsoft office word has not been installed for the current user"
How can I make it think that the php script is me?
__________________
Aye!
Reply With Quote
  #5 (permalink)  
Old 12-15-07, 08:24 AM
job0107's Avatar
job0107 job0107 is offline
Community Liaison
 
Join Date: Dec 2006
Location: Tacoma, Washington USA
Posts: 3,454
Thanks: 0
Thanked 140 Times in 137 Posts
If you read the documentation, it says you must have Microsoft word installed on the server in order to access it.

If this is not your server then you will have a problem if you can't get your ISP to install Microsoft word.

I am not sure if you can upload Microsoft word to the server and put it in a folder for you to use, or if it is even legal.
__________________
Jerry Broughton
Reply With Quote
  #6 (permalink)  
Old 12-15-07, 08:40 AM
Deansatch Deansatch is offline
Coding Addict
 
Join Date: Jul 2006
Location: Northumberland
Posts: 375
Thanks: 0
Thanked 0 Times in 0 Posts
I am using my own local apache server. Word is installed on the same computer. Does it need to be installed in a different way?
__________________
Aye!
Reply With Quote
  #7 (permalink)  
Old 12-15-07, 09:41 AM
mab's Avatar
mab mab is offline
Community VIP
 
Join Date: Oct 2005
Location: Denver, Co. USA
Posts: 2,674
Thanks: 0
Thanked 0 Times in 0 Posts
The message would indicate that the user account on your computer that Word is installed/available to is different from the user account that your web server/php is running under.

The less secure approach would be to allow the user account that the web server/php is running under to have access to the installed copy of Word. The more secure approach would be to install a second "private" copy of Word under the user account that the web server/php is running under.

Back to your first post, if your goal is to produce word documents, then pursue the current method. But word is not a good web site layout tool. What is your actual goal, producing actual word documents, producing web pages with the information on them, or printing pages with just the information on them that don't contain the extra information that you get when you print a web page?
__________________
Error checking, error reporting, and error recovery. If your code does not have these to get it to tell you why it is not working, what makes you think someone in a programming forum will be able to tell you why it is not working???
Reply With Quote
  #8 (permalink)  
Old 12-17-07, 02:21 PM
martyncoup martyncoup is offline
Newbie Coder
 
Join Date: Dec 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
We get this all the time at work, check these out...

http://www.google.com/search?q=word+...ient=firefox-a
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
php form variables to excel spread sheet Andy128 PHP 5 06-19-06 07:37 AM
how to use onclick in php coolcoder HTML/XHTML/XML 2 05-31-06 12:40 PM
Php Mysql Bug??? tranquilraven PHP 4 03-01-06 03:06 AM
PHP multi-dimensional array sorting issue aqw PHP 2 06-24-05 11:09 PM
PHP / Graphic Developers someotherguy582 Job Offers & Assistance 1 06-05-05 07:40 PM


All times are GMT -5. The time now is 07:33 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.