| To output the local variable that you created: |
MyFirstPage.cfm in HomeSite.<CFOUTPUT>
#Variables.ProductName#
</CFOUTPUT>
If you performed the procedures presented in the last chapter, then you have already referenced the ProductName local variable. Prefix the variable now.
Your page should look like this now:
<HTML>
<HEAD>
<TITLE>My First Page</TITLE>
</HEAD>
<BODY>
<STRONG>ColdFusion</STRONG>
<CFSET ProductName="ColdFusion">
<CFOUTPUT>
#Variables.ProductName#
</CFOUTPUT>
</BODY>
</HTML>
The CFML tags were processed on the server.
The current variable value is returned as text to the browser.
<CFOUTPUT>
<STRONG>#Variables.ProductName#</STRONG>
</CFOUTPUT>
<CFOUTPUT>
The product name is <STRONG>#Variables.ProductName#</STRONG>.
</CFOUTPUT>
The HTML formatting and text is returned to the browser.
The CFML tags were processed on the server.
Click here to see the Chapter 4 solution file that's delivered with this product.
Click here to see the code behind the scenes.
You have output the current value of a local variable. You will perform the same procedure to output other types of variables. Move on in this chapter to learn about how you work with and output CGI variables.