Current location: Hot Scripts Forums » Programming Languages » PHP » word formatting to html via php


word formatting to html via php

Reply
  #1 (permalink)  
Old 05-07-05, 06:34 AM
buzzby buzzby is offline
Newbie Coder
 
Join Date: Apr 2004
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
word formatting to html via php

is there a way to carry/port/copy to page a word document with text formatting such as underline, bold, italics etc? so far the only way i know is just to save the word document as .htm(l). but that brings so much unwanted code with it and is a pain to take out.

i am thinkin about my clients who want to update their pages (clumps of text rather than complete changes) but dont want to go thru a cms becuase of the lack of time on their hands (pretty understandable).

nl2br works really well for paragraphs and new lines which covers .txt files but when it comes to bold or underlined text then you have to put those tags into the .txt file which alot of my clients wont understand.

alot of the cms progs out there are quite complicated. their structure isnt of a standard that a layman(woman) can just pick it up.

i am not sure how easy or hard this is to answer but any assisstance would be of great help
Reply With Quote
  #2 (permalink)  
Old 05-07-05, 09:06 AM
koncept
Guest
 
Posts: n/a
try this rich text editor, it is fairly simple to use
Attached Files
File Type: zip rte.zip (21.8 KB, 105 views)
Reply With Quote
  #3 (permalink)  
Old 05-08-05, 04:03 AM
buzzby buzzby is offline
Newbie Coder
 
Join Date: Apr 2004
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
i got the rte editor. i must say that i am not really happy with it. i have tried to copy text from word so i can keep the formatting via tags. when i view it in the rte everything looks fine. when i then take a look at the source code i was horrified to see that rte has taken all the word html conversion code and brought it in. if i delete it and put exactly the same text in the rte with all the italics and bold and underlining, then it works great. rte has not solved the problem at all unless there is a button to strip all the word xml xlt stuff.

this is what i mean:

"this is the text i want to use

This is the way I want to do it
Underline this text
Italicise this text
Bolden this text

Lets see if this is really what I want to see"

when i input it in the editor i get the right result:
Code:
<P>This is the way I want to do it </P>
<P><U>Underline this text</U> <BR><EM>Italicise this text</EM> <BR><STRONG>Bolden this text</STRONG> </P>
<P>Lets see if this is really what I want to see</P>
when i put it in word and then copy and paste it i get this:

Code:
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">This is the way I want to do it</P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><U>Underline this text<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></U></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><I style="mso-bidi-font-style: normal">Italicise this text<o:p></o:p></I></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><B style="mso-bidi-font-weight: normal">Bolden this text<o:p></o:p></B></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><o:p>&nbsp;</o:p></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">Lets see if this is really what I want to see</P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">&nbsp;</P>
not exactly the same is it

Last edited by buzzby; 05-08-05 at 04:10 AM.
Reply With Quote
  #4 (permalink)  
Old 05-08-05, 12:22 PM
FiRe FiRe is offline
Code Guru
 
Join Date: Oct 2004
Location: UK
Posts: 801
Thanks: 0
Thanked 0 Times in 0 Posts
yes word has its own style of coding, i dont think u can do it!
__________________
Alexa Share <-- Trade virtual shares in websites with this online game.

codR.us <-- Submit and vote for your favorite code snippets with codR.us.

XEWeb.net <-- The ultimate PHP resource network.
Reply With Quote
  #5 (permalink)  
Old 05-08-05, 08:08 PM
koncept
Guest
 
Posts: n/a
u can probaly write a complex function to do it, but its probaly not worth it
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP in HTML Pages? ZeoFateX PHP 19 01-04-06 06:42 PM
Please help insert html into php idforforums PHP 5 04-06-05 11:29 PM
Putting PHP into a HTML page? PigeonHead HTML/XHTML/XML 5 01-24-05 02:22 PM
PHP to calculate HTML forms jamesian PHP 1 10-25-04 07:45 AM
Can PHP place quotes around HTML attributes frdmsun PHP 1 08-17-04 02:12 AM


All times are GMT -5. The time now is 06:44 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.