Additional Data Sources

So far, you’ve used Dreamweaver’s dynamic page-building features to retrieve information from databases to build catalog pages, product detail pages, and other database-dependent pages. But occasionally you want to collect data from other sources and add it to your page. For example, when someone logs into a site (see Creating the Login Page), her user name travels along with her from page to page in what’s called a session variable. Using the Bindings panel, you can capture this name and use it on a web page.

Similarly, you can create cookies to store small pieces of information on a person’s computer—such as a counter that tracks how many times a visitor’s been to your site—and use Dreamweaver’s Bindings panel to add that information to a web page.

The Bindings panel lets you access these sources of data, as well as information submitted from form fields and embedded in URLs. You can add any number of other data sources to the Bindings panel (see Figure 26-6), and then add those data sources to your web page.

Adding a source to a page automatically inserts the programming code needed to retrieve the information from the data source. It’s important to make clear that you aren’t creating these various data sources—such as cookies, URL variables, or session variables—when you add them to the Bindings panel. Dreamweaver just provides an easy way to retrieve the value of already created variables. For example, adding a cookie variable to the Bindings panel doesn’t ...

Get Dreamweaver CS5: The Missing Manual now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.