Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 331

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Developing CFML Applications
<html>
<head>
<title>cflock Example</title>
</head>
<body>
<h3>cflock Example</h3>
<cfif IsDefined("Form.submit")>
<!--- Lock session variables --->
<!--- Note that we use the automatically generated Session
ID as the order ID --->
<cflock scope="Session"
timeout="10" type="ReadOnly">
<cfoutput>Thank you for shopping E-Turtleneck.
Today you have chosen a turtleneck in size
<b>#form.size#</b> and in the color <b>#form.color#</b>.
Your order ID is #Session.sessionID#.
</cfoutput>
</cflock>
<!--- Lock session variables to assign form values to them. --->
<cflock scope="Session"
timeout="10"
type="Exclusive">
<cfparam name=Session.size default=#form.size#>
<cfparam name=Session.color default=#form.color#>
</cflock>
<
!--- Lock the Application scope variable application.number to
update the total number of turtlenecks sold. --->
<cflock scope="Application"
timeout="30" type="Exclusive">
<cfset application.number=application.number + 1>
</cflock>
<!--- Show the form only if it has not been submitted. --->
<cfelse>
<form action="cflock.cfm" method="Post">
<p> Congratulations! You have just selected
the longest-wearing, most comfortable turtleneck
in the world. Please indicate the color and size
you want to buy.</p>
<table cellspacing="2" cellpadding="2" border="0">
<tr>
<td>Select a color.</td>
<td><select type="Text" name="color">
<option>red
<option>white
<option>blue
<option>turquoise
<option>black
Last updated 1/20/2012
326

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents