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.

TABLE OF CONTENTS:
  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
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

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
   

PHP ARTICLES

- 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...
- PHP: Building Concrete Validators
- Sanitizing Input with PHP
- Executing Shell Commands with PHP
- Handling File Data with PHP
- File Security and Resources with PHP
- ArrayObject PHP Class Examples
- ArrayObject PHP Class: An Introduction
- Getting File System Data with PHP
- PHP Tools for Working with the File and Oper...
- Working with the File and Operating System w...
- PHP Proxy Patterns: Completing a Blog


© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 3 - Follow our Sitemap

Dev Shed Tutorial Topics: