MACROMEDIA COLDFUSION MX 61-CFML Reference page 320

Cfml reference
Hide thumbs Also See for COLDFUSION MX 61-CFML:
Table of Contents

Advertisement

<p>In addition, cfset can be used to pass variables from other pages,
such as this example, which takes the url parameter Test from this link:
(<a href = "cfset.cfm?test = <cfoutput>
">click here</A>) to display a message:
<p>
<cfif IsDefined ("url.test") is "True">
<cfoutput><b><I>#url.test#</i></b></cfoutput>
<cfelse>
<h3>The variable url.test has not been passed from another page.</h3>
</cfif>
<p>cfset can also be used to collect environmental variables, such as the
time, the IP address of the user, or another function or expression.
<cfset the_date = #DateFormat(Now())# & " " & #TimeFormat(Now())#>
<cfset user_ip = CGI.REMOTE_ADDR>
<cfset complex_expr = (23 MOD 12) * 3>
<cfset str_example = Reverse(Left(GetMessages.body, 35))>
<cfoutput>
<ul>
<li>The date: #the_date#
<li>User IP Address: #user_ip#
<li>Complex Expression ((23 MOD 12) * 3): #complex_expr#
<li>String Manipulation (the first 35 characters of
the body of the first message in our query)
<br><b>Reversed</b>: #str_example#
<br><b>Normal</b>: #Reverse(str_example)#
</ul>
</cfoutput>
320
Chapter 2: ColdFusion Tags
#URLEncodedFormat("hey, you, get off of my cloud")#</cfoutput>

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents