Home arrow PHP arrow PHP: Creating Word Documents without .COM Objects

PHP: Creating Word Documents without .COM Objects

If you are looking for a solution to create MS Word documents without the use of .COM objects, then this tutorial will be helpful. In it, you will learn how to build an actual PHP application that can convert a .txt file into a .doc file online.

  1. PHP: Creating Word Documents without .COM Objects
  2. Strategy for creating this application
  3. The Basic Web Form Source Code
  4. PHP Script: Validation, File get Contents and Writing to .doc file
  5. Deleting Temporary Files in the Server Upload directory
By: Codex-M
Rating: starstarstarstarstar / 5
July 26, 2010

print this article



Important Requirements

Before you implement this application in your own test server, bear in mind that this was tested to work on the following setup:

  • PHP Version: 5.2.5
  • Server: Apache
  • OS: Linux
  • MS Word version: MS Word 2002

You will need the following PHP functions/components to make this work:

  • require_once
  • $_FILES
  • file_get_contents
  • mt_rand
  • fopen
  • fwrite

This web application won't work if you try to implement it on a free web hosting platform, because hosting agencies will disable some of the functions listed above.

Also you will need to have a recaptcha account; this is the captcha solution that is used for this application. For the recaptcha to work, you will need:

a. Public Key

b. Private Key

c. Recaptcha PHP library files

You can get that on this page: http://www.google.com/recaptcha

It is highly recommended that you test this application first in the local server, such as XAMPP. So make sure you have a PHP-Apache test server installed on your system before uploading files to your web hosting company.

>>> More PHP Articles          >>> More By Codex-M

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates


Dev Shed Tutorial Topics: