Chapter 9. HTML Forms


PHP was originally designed for use on the Internet, and although you can now use it for command-line applications and GUIs, its main purpose remains working on the Web. When it comes to the Web, HTML has ruled unchallenged for some years as the de facto standard for displaying information, even more so now that WAP usage has evaporated. This means that if you want to write a frontend for your PHP web applications, you need to understand HTML.

HTML is a very simple markup language that offers its users a great deal of flexibility. While this might make it easy to learn and write in, it makes the job of web browsers such as Internet Explorer and Mozilla much harder, because they need to be able to cope with thousands of exceptions.

The problem with HTML is that it became used to express style instead of just information. For example, designers would use HTML to specify the font of a piece of text, as opposed to what that the text was. With content and style so irretrievably mixed inside HTML, computers were not able to extract information about a document simply by reading through the HTML tags used.

A movement was started to redefine how web pages are designed so that HTML would contain only content information, with a new language, CSS (cascading style sheets) storing the style information. There were also some recommending that XML was the way forward for data, and that HTML could be eliminated altogether. While the XML argument made sense, many realized that there were simply too many HTML-based web sites in existence to be able to just drop HTML, so the standard "XHTML " was borna modification of HTML that makes it XML-compliant.

The code you see in this book is all XHTML-compliant, and I recommend you keep to this in your own work. You may notice that all HTML attributes are surrounded by quotes, and all HTML tags used in this book are closed either by using </tag> or <tag/>these are two of the rules enforced in XHTML. While teaching HTML and /or XHTML is outside the scope of this book, we are at least going to look at creating HTML forms, which are the primary means of sending data to PHP.



PHP in a Nutshell
Ubuntu Unleashed
ISBN: 596100671
EAN: 2147483647
Year: 2003
Pages: 249

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net