Define server variables – Adobe Dreamweaver CC 2014 v.13 User Manual
Page 617

For example, this ColdFusion example instantiates a session called username, and assigns it the value Cornelius:
2. Select Window > Bindings to display the Bindings panel.
3. Click the Plus (+) button, and select Session Variable from the pop-up menu.
4. Enter the name of the variable you defined in the application’s source code, and click OK.
Define application variables for ASP and ColdFusion
In ASP and ColdFusion, you can use application variables to store and display information that is maintained for the lifetime of the application and
persists from user to user. After you define the application variable, you can use its value in a page.
Note: There are no application variable objects in PHP.
1. Open a dynamic document type in the Document window.
2. Select Window > Bindings to display the Bindings panel.
3. Click the Plus (+) button, and select Application Variable from the pop-up menu.
4. Enter the name of the variable as defined in the application’s source code, and click OK.
The application variable appears in the Bindings panel under the Application icon.
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.
610