From a coding perspective, the major difference between a static HTML page and a ColdFusion application page is that ColdFusion pages contain an additional language, CFML.
CFML is a markup language that's very similar in syntax to HTML so Web developers find it intuitive.
Unlike HTML which defines how things are displayed and formatted on the client, each CFML tag identifies a specific operation that is performed on ColdFusion Server.
During this chapter, you will mix CFML with HTML to see, firsthand, how CFML is processed on the server. In subsequent chapters, you will learn how you to use CFML to perform specific server-side processing.
|To add CFML to your page:|
MyFirstPage.cfmin Allaire HomeSite.
You use the CFSET tag to initialize variables with a value.
You will learn more about CFSET in the next chapter.
<CFOUTPUT> The product name is #ProductName#. </CFOUTPUT>
You use the CFOUTPUT tag to output ColdFusion values to a page.
You will learn more about CFOUTPUT in the next chapter.
Your code should look like this:
<HTML> <HEAD> <TITLE>My First Page</TITLE> </HEAD> <BODY> <STRONG>ColdFusion</STRONG> <CFSET ProductName="ColdFusion"> <CFOUTPUT> The product name is #ProductName#. </CFOUTPUT> </BODY> </HTML>
"The product name is ColdFusion." appears below ColdFusion in the browser.
ColdFusion Server processes the CFSET and CFOUTPUT tags and returns HTML to the browser.
Click here to see how the file should look in a browser.
Click here to see the code behind the scenes.
You have created a ColdFusion application page that includes HTML and CFML and have followed the ColdFusion development process. Move on in this chapter to learn about other development considerations.