beautypg.com

Define server variables, Define coldfusion server variables – Adobe Dreamweaver CC 2015 User Manual

Page 581

background image

574

Dynamic sites, pages and web forms

Last updated 6/3/2015

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.

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.

The following table lists the built-in ColdFusion server variables: