Discussion on:
View:
Show:
Have you ever been presented with this particular conversion problem? How did you solve it? Do you have different script you could share with TechRepublic members?
Great article!
However, on my main site I have php4 and have been struggling to re-interpret this script to create and write a new html file.
Any tips?
Thank you for a great article
However, on my main site I have php4 and have been struggling to re-interpret this script to create and write a new html file.
Any tips?
Thank you for a great article
1. Why remove extra spaces? What's the point of that? Display by a browser automatically reduces additional whitespace so that only a single space is displayed. It's part of the (X)HTML standard. That's a waste of a line of code.
2. I can understand the header and footer code for generating static HTML pages, but if all you're going to do is echo the content of your variable to the browser, you might as well just add the headers and footers at the beginning and ending of the script as it is. Alternatively, you can separate functionality for reuse by other scripts, and just echo the actual main body text, then have a separate file with the headers and footers as a static part of that other file and an include() or require() statement to call your text formatting file.
2. I can understand the header and footer code for generating static HTML pages, but if all you're going to do is echo the content of your variable to the browser, you might as well just add the headers and footers at the beginning and ending of the script as it is. Alternatively, you can separate functionality for reuse by other scripts, and just echo the actual main body text, then have a separate file with the headers and footers as a static part of that other file and an include() or require() statement to call your text formatting file.
Thanks a lot for the script. My immediate challenge is to convert Msword doc(i.e .doc) files to HTML.
I do not want to use COM or DOM as my version of PHP(ver 4.3) do not support it.
Do you have any ideas. I always get lots of gabbage when I try the rendering of word to html or text
I do not want to use COM or DOM as my version of PHP(ver 4.3) do not support it.
Do you have any ideas. I always get lots of gabbage when I try the rendering of word to html or text
It is true that you get a lot of gargbage when you use Word to save a document in HTML format. However, the HTML page usually looks pretty clean when viewed in a browser (at least it does when viewed in IE...go figure). But if you ever want to maintain it or add or remove something from the HTML, you have to struggle through all the extra tags that Word creates. You could try saving to a text document then applying the rules that Mr. Kaelin referred to at the beginning of this discussion.
How do you transform this whole code froM HTML TO PHP using markup language
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
AOM
#container{
width: 610px;
text-align: left;
margin: 0 auto auto auto;
padding: 0 auto auto auto;
}
Name: (required)
Phone: (required, only numbers ex: 5553338899)
Select Your City
Atlanta
Chicago
Houston
Los Angeles
New York
Select your language
English
Spanish
Official Rules
©2008 America On the Move Foundation, Inc. All Rights Reserved.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
AOM
#container{
width: 610px;
text-align: left;
margin: 0 auto auto auto;
padding: 0 auto auto auto;
}
Name: (required)
Phone: (required, only numbers ex: 5553338899)
Select Your City
Atlanta
Chicago
Houston
Los Angeles
New York
Select your language
English
Spanish
Official Rules
©2008 America On the Move Foundation, Inc. All Rights Reserved.
- Keyboard Shortcuts:
- Prev
- Next
- Toggle









































