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.

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???

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.