Creating a ColdFusion page

Creating a ColdFusion page involves using tags and functions. The best way to understand this process is to create a ColdFusion page.

In the following procedure, you will create a simple ColdFusion page by using HTML tags, one ColdFusion tag, and two ColdFusion functions. The following table briefly explains the ColdFusion tags and functions:

Element

Description

Now() 

A function supported in CFML that you can use to retrieve information from your system.

You will use the Now() function in the following procedure to return the current date that is retrieved from your system.

DateFormat()

A function that instructs ColdFusion to format the date returned by the Now() function.

cfoutput

A ColdFusion tag that you use to return dynamic data (data retrieved from a database) to a web page.

You will use the cfoutput tag in the following procedure to display the current date retrieved from your system.

Note: ColdFusion tags and functions are considered primary elements of CFML. You will learn more about these elements and others later in this manual.

To create a ColdFusion page:

  1. Open your editor and create a blank file.
  2. Enter the following code on the page:
    <html>
    <head>
    <title>A ColdFusion Page</title>
    </head>
    <body>
    <strong>Hello world, this is a ColdFusion page.</strong> 
    <br>
    <cfoutput> Today’s date is #DateFormat(Now())# </cfoutput>
    </body>
    </html>