Introducing the Story Program

Introducing the Story Program

By the end of this chapter, you'll be able to write the program featured in Figures 2.1 and 2.2.

Click To expand
Figure 2.1: The program begins by asking the user to enter some information.
Click To expand
Figure 2.2: I hate it when the warthog's in the kohlrabi.

The program asks the user to enter some values into an HTML form, and then uses those values to build a custom version of a classic nursery rhyme. The story program works like most server-side programs. It has two distinctive parts. First, the user enters information into a plain HTML form and hits the submit button. The PHP program doesn't execute until after the user has submitted a form. The program takes the information from the form and does something to it. Usually the PHP program also returns an HTML page to the user.