beautypg.com

Define server variables – Adobe Dreamweaver CS3 User Manual

Page 566

background image

DREAMWEAVER CS3

User Guide

559

See also

“About adding dynamic content” on page 564

“Define server variables” on page 559

Use a variable as a data source for a ColdFusion recordset

When you define a recordset for a page in the Bindings panel, Dreamweaver enters the name of the ColdFusion data
source in the

cfquery

tag on the page. For more flexibility, you can store a data source name in a variable and use

the variable in the

cfquery

tag. Dreamweaver provides a visual method of specifying such a variable in your

recordsets.

1

Make sure a ColdFusion page is active in the Document window.

2

In the Bindings panel, click the Plus (+) button and select Data Source Name Variable from the pop-up menu.

The Data Source Name Variable dialog box appears.

3

Define a variable, and click OK.

4

When defining the recordset, select the variable as the Data Source for the recordset.

In the Recordset dialog box, the variable appears in the Data Source pop-up menu along with the ColdFusion data
sources on the server.

5

Complete the Recordset dialog box, and click OK.

6

Initialize the variable.

Dreamweaver does not initialize the variable for you so that you can initialize it how and where you want. You can
initialize the variable in the page code (before the

cfquery

tag), in an include file, or in some other file as a session

or application variable.

Define server variables

You define server variables as sources of dynamic content for use within a web application. Server variables vary from
document type to document type and include form variables, URL variables, session variables, and application
variables.

Server variables can be accessed by all clients that access the server, and by any applications running on the server.
The variables persist until the server is stopped.

See also

“Adding dynamic content to pages” on page 564

“URL parameters” on page 533

“HTML form parameters” on page 532

“ColdFusion server variables” on page 545

Define ColdFusion server variables

1

Open the Bindings panel (Window > Bindings). In the Server Variable dialog box, enter the name of the server

variable, and click OK.

2

Click the Plus (+) button and select the server variable from the pop-up menu.

3

Enter the name of the variable, and click OK. The ColdFusion server variable appears in the Bindings panel.

September 4, 2007