Hi All, i created text editor on web. i want to save all content of editor in word document. can any one help me how to save all content of editor in doc. Thanks, Sam
Hi All, can any one help me for creating text editor same as digital forums. it should save in ms word. please send code or Advice me on this is highly appreciated.
there are premade text editor like here in DP... try using TinyMCE http://tinymce.moxiecode.com/ for your question.. how to make a word doc... first write it in a php file here's the sample script. <?php $filename = 'test.txt'; $somecontent = "Add this to the file\n"; if (is_writable($filename)) { if (!$handle = fopen($filename, 'a')) { echo "Cannot open file ($filename)"; exit; } if (fwrite($handle, $somecontent) === FALSE) { echo "Cannot write to file ($filename)"; exit; } echo "Success, wrote ($somecontent) to file ($filename)"; fclose($handle); } else { echo "The file $filename is not writable"; } ?> make sure its written, then download the file by a word document format.. here's the code <?php header('Content-type: application/msword'); header('Content-Disposition: attachment; filename="download.doc"'); readfile('thefilename of the doc'); ?>