Chapter 12. PHP and Other Support for Database-driven HTML

Several easy-to-use program HTML extensions provide support for accessing MySQL and mSQL database servers within web pages. In this chapter, we will start with W3-mSQL—a mSQL-specific tool. We will then show how to take the more database-independent approach with PHP and two minor Perl extensions. The W3-mSQL scripting language, Lite, lets you embed entire programs into an HTML file. A CGI program executes the script and sends the result to the reader as a dynamically created HTML document.

Since W3-mSQL and the other extensions in this chapter use their own scripting languages and hide all evidence of CGI, knowledge of the previous chapters of this section is not necessary for this chapter. However, understanding how CGI works, as well as having some prior programming experience (Lite is similar to both C and Perl), can be useful when reading this chapter.

Alternatives for Dynamic Content on the Web

The World Wide Web’s first encounter with what we now call Dynamic HTML was Server Side Includes (SSI). The idea behind SSI is that there are certain common values, such as the current date and time, that would be useful to include in an HTML page but impracticable because they change so often. SSI provided a method by which an HTML page could tell the server to insert a value into the HTML page before sending it to the end user. That way the value would always be current, but the creator of the page would not have to continuously ...

Get MySQL and mSQL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.