Chapter 16. PHP

PHP is a server-side, HTML-embedded, cross-platform scripting language—quite a mouthful. In simpler terms, PHP provides a way for you to put instructions in your HTML files to create dynamic content. These instructions are read and parsed by the web server; they never actually make it to the browser that is displaying the page. The web server replaces your PHP code with the content that the code was written to produce.

PHP can be configured to run either as a server module or as a standalone CGI script. At the time of this writing, the server-module version is production-ready for the Apache web server only on Unix systems. The CGI version runs with all web servers on both Unix and Windows 95/98/NT. On the Windows platform, the server module is being developed to work with ISAPI, NSAPI, and WSAPI, which means the server module will eventually work with Microsoft’s IIS, Netscape’s Enterprise Server, and O’Reilly & Associates’s WebSite. See http://www.php.net for availability details.

The PHP language itself borrows concepts from other common languages, such as C and Perl. If you have some experience with one of these languages, you should feel right at home with PHP. In addition to the core language, PHP provides a wide variety of functions that support everything from array manipulation to regular-expression support.

Database connectivity is one popular use for PHP. PHP supports a large number of databases natively, and many others are accessible through PHP’s ODBC ...

Get Webmaster in a Nutshell, Second Edition 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.