Adobe 38040334 - Dreamweaver CS3 User Manual page 543

Pc
Hide thumbs Also See for 38040334 - Dreamweaver CS3:
Table of Contents

Advertisement

DREAMWEAVER CS3
536
User Guide
A form-based survey is a typical example of a page that stores form parameters in session variables. The form sends
the selected information back to the server, where an application page scores the survey and stores the responses in
a session variable to be passed to an application that might tally up the responses gathered from the survey
population. Or the information might be stored in a database for later use.
After information is sent to the server, you store the information in session variables by adding the appropriate code
for your server model to the page specified by the URL or form parameter. Referred to as the destination page, this
page is specified in either the
attribute of the HTML form or the
attribute of the hypertext link on the
action
href
starting page.
After you store a value in a session variable, you can use Dreamweaver to retrieve the value from session variables
and use it in a web application. After you define the session variable in Dreamweaver, you can insert its value in a
page.
The HTML syntax for each appears as follows:
<form action="destination.html" method="get" name="myform"> </form>
<param name="href"value="destination.html">
Both the server technology used and the method you use to obtain the information determines the code used to store
the information in a session variable. The basic syntax for each server technology is as follows:
ColdFusion
<CFSET session.variable_name = value>
ASP and ASP.NET
<% Session("variable_name") = value %>
The
expression is usually a server expression such as
. For example, if you use
value
Request.Form("lastname")
a URL parameter called
(or an HTML form with the
method and a text field called
) to gather
product
GET
product
information, the following statements store the information in a session variable called
:
prodID
ColdFusion
<CFSET session.prodID = url.product>
ASP and ASP.NET
<% Session("prodID") = Request.QueryString("product") %>
If you use an HTML form with the
method and a text field called
to gather the information, then
post
txtProduct
the following statements store the information in the session variable:
ColdFusion
<CFSET session.prodID = form.txtProduct>
ASP and ASP.NET
<% Session("prodID") = Request.Form("txtProduct") %>
See also
"Adding dynamic content to pages" on page 564
"Define session variables" on page 558
September 4, 2007

Advertisement

Table of Contents
loading

This manual is also suitable for:

Dreamweaver cs3

Table of Contents