Comments on Example 2.3
Example 2-3 is complete but isn't especially interesting. Regardless of how many times the script is executed, the result is the same web page. In practice, you might consider running the script once, capturing the output, and saving it to a static HTML file. If you save the output as HTML, the user can retrieve the same page, with less web-server load and a faster response time.
In Chapter 4, we introduce more PHP scripts that don't support input from the user. However, the difference is that the scripts interact with the MySQL DBMS and run SQL queries. The result is that the pages can change if the underlying data in the database is updated. Therefore, unlike our simple example here, the scripts in Chapter 4 may not be readily replaced with static HTML pages.