13.09.2016 Views

PHP and MySQL Web Development 4th Ed-tqw-_darksiderg

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Project Overview<br />

773<br />

Hypertext Markup Language<br />

An obvious choice for delivering a document on the <strong>Web</strong> is Hypertext Markup<br />

Language (HTML). Hypertext Markup Language is specifically designed for this purpose.<br />

As you are no doubt already aware, it includes formatting control, syntax to include<br />

objects such as images, <strong>and</strong> is compatible (with some variation) with a variety of operating<br />

systems <strong>and</strong> software. It is fairly simple, so it is both easy to design <strong>and</strong> quick for a<br />

script to generate <strong>and</strong> deliver.<br />

Drawbacks to using HTML for this application include limited support for printrelated<br />

formatting such as page breaks, little consistency in the output on different platforms<br />

<strong>and</strong> programs, <strong>and</strong> variable quality printing. In addition, although HTML can<br />

include any type of external element, the capability of the browser to display or use<br />

these elements cannot be guaranteed for unusual types.<br />

Word Processor Formats<br />

Particularly for intranet projects, providing documents as word processor documents<br />

makes some sense. However, for an Internet project, using a proprietary word processor<br />

format will exclude some visitors, but given its market dominance, Microsoft Word<br />

would make sense. Most users will either have access to Word or to a word processor<br />

that will try to read Word files such as OpenOffice Writer.<br />

Windows users without Word can download the freeware Word Viewer from<br />

http://office.microsoft.com/en-us/downloads/ha010449811033.aspx.<br />

Generating a document as a Microsoft Word document has some advantages. As long<br />

as you have a copy of Word, designing a document is easy.You have very good control<br />

over the printed appearance of your documents <strong>and</strong> a lot of flexibility with its contents.<br />

You can also make it relatively difficult for the recipient to modify by telling Word to ask<br />

for a password.<br />

Unfortunately,Word files can be large, particularly if they contain images or other<br />

complex elements.There is also no easy way to generate them dynamically with <strong>PHP</strong>.<br />

The format is documented but is a binary format, <strong>and</strong> the format documentation comes<br />

with license conditions. It is possible to generate Word documents with a COM object,<br />

but it’s definitely not simple.<br />

Another possibility you may now consider is OpenOffice Writer, which has the dual<br />

advantages of not being proprietary software <strong>and</strong> using an XML-based file format. Office<br />

2003 <strong>and</strong> 2007 also support an XML file format natively.The Document Type<br />

Definition (DTD) for Word <strong>and</strong> other Office products can be downloaded from<br />

Microsoft.com. Search for “Office XML Reference Schemas.”This would be a valid<br />

option, but not a simple one.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!