O'Reilly logo

Adobe ColdFusion 8 Web Application Construction Kit, Volume 1: Getting Started by Charlie Arehart, Raymond Camden, Ben Forta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Variables

Now that you’ve had the chance to use some basic functions, it’s time to introduce variables. Variables are an important part of just about every programming language, and CFML is no exception. A variable is a container that stores information in memory on the server. Variables are named, and the contents of the container are accessed via that name. Let’s look at a simple example. Type the code in Listing 8.4 into a new file (feel free to use your own name instead of mine), save it as hello4.cfm, and browse it. You should see a display similar to the one shown in Figure 8.7.

Figure 8.7. Variables are replaced by their contents when content is generated.
Listing 8.4. hello4.cfm
<html> <head> <title>Hello ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required