Passing Information Between Pages

Every now and then, you’ll want to pass a piece of information from one page to another. The Master Detail Page Set described in the previous section uses this concept: A link on the master page not only points to the detail page, but also passes along the unique ID used to create a filtered recordset on the detail page. In other words, the master page lists a bunch of records from a database. Each record not only links to its own detail page, but also passes along its unique ID. The link might be something like productDetails.php?productID=7.

The information after the ? in the above URL is a URL parameter, which the detail page uses to build a recordset. In this example, the detail page would find only one record—the one whose productID is 7—and display its details on the page. The key to the success of the Master Detail Page Set, then, is the ability to pass information to another page, and then use that information to filter a recordset (see Filtering Information for details on filtering database records).

To retrieve the details for only one record, the detail page must include a recordset that filters the records of a database table based on some unique identifier—usually a record’s primary key. For example, if every ad in a database of advertisements has its own unique ad ID, to find info on just a single ad, you simply search for the one record that matches a particular ID number. In other words, you create a recordset that filters the data ...

Get Dreamweaver CS5: The Missing Manual 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.