Jump to content

[SOLVED] Need Help how to CREATE MsWord using PHP


andz

Recommended Posts

Good day everyone.

 

I have a problem on my project that I need to approach as soon as possible.

 

How do I create an MsWord document using PHP and populate its content with MySQL without installing additional resources or in short just simply native PHP coding, no other script attached.

 

I'm using PHP4.

 

Thank you very much.

Link to comment
Share on other sites

I have here a simple solution and it works for me.

 

I just take the old-fashioned way using fopen() and fwrite() and fclose();

 

here's the code below.

 

<?php

$txtFile = fopen('file.doc') or die('UNABLE TO OPEN');

 

$input = 'Hello world';

 

if (!fwrite($txtFile, $input)) {

  die ('UNABLE TO WRITE');

}

 

fclose($txtFile);

?>

 

I'm running an xampp on windows as web server. Probably if this will work on live server, i'll just have to edit the permissions into *777.

 

What do you think???

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.