You saw how a Web server sends information to the client in the form of HTML documents and how the client interacts with the server by means of hyperlinks. You also saw how to design Web pages that collect information from visitors on the client and submit it to the server along with the URL. When the server receives data (or parameter values, as they are called) from a client, it must process the data and return the results to the client in HTML format. In this chapter, I am going to discuss how parameters are retrieved by the server and how they are processed. This is the most important part of client-server interaction and (until the release of the Active Server Pages) the most difficult to implement.
The parameters submitted by a client can be anything-registration data, search arguments, customization data, anything. Businesses are interested in the information that is stored in databases and the must be retrieved as needed. To retrieve up-to-the-minute information from a Web server, the client must send back more information than simply the name of Hyperlink. Think about a user on client who requests the sales of a specific product in North Carolina or a list of the most active customers in Texas. This information must be retrieved from a database the moment it’s requested; it can’t be a document that has been prepared ahead of time, waiting on the server’s disk to be retrieved. The requested information must be extracted from the database when it’s requested, encoded in HTML format on the fly, and transmitted to the client.
Many companies (of all sizes) are already doing business on the Web. A commercial Web site should be able to present information about the products to a visitor and collect order information (items/quantities, shipping address, and so on). I’ll also discuss the requirements of commercial Web sites in this chapter.