As discussed in Chapter 1, ColdFusion pages are plain text files that you use to create web applications. You can create your ColdFusion applications by writing all the code manually or by using wizards (provided with some editors) to generate the majority of the code for you.
You can use the following editors to create your ColdFusion pages:
The best choice for creating ColdFusion pages is Macromedia Dreamweaver MX. Dreamweaver MX includes many CFML features for building applications, such as rapid visual development, robust CFML editing, and integrated debugging. Dreamweaver MX also includes a copy of HomeSite+ for users who are familiar with developing their application code using ColdFusion Studio or HomeSite 5. HomeSite+ combines all the features of ColdFusion Studio and HomeSite 5, along with support for the latest ColdFusion MX tags.
Note: This book shows how to create ColdFusion applications by writing your code manually. It does not address how to create ColdFusion pages by generating code with wizards. For information about using wizards to generate CFML code, see the product documentation for Dreamweaver MX and HomeSite+.
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:
Note: ColdFusion tags and functions are considered primary elements of CFML. You will learn more about these elements and others later in this book.
<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>
In order for the ColdFusion server to process the page, you must save the ColdFusion page on a computer where the ColdFusion server is installed. If you are creating your pages on a local server (on which ColdFusion is running), then you can save the pages locally; if you are using a remote server, then you must save your pages on that server.
To publish ColdFusion pages on the Internet, you must save the pages under the web-root directory.
To ensure that the code you wrote is working as expected, you must view the ColdFusion page in a browser. The following procedure describes how to view the ColdFusion page that you created earlier.
http://127.0.0.1/test/cfpage.cfm
The address 127.0.0.1 refers to the localhost and is only valid when you view pages locally. The URL for a remote site would include the IP address of the server where ColdFusion is installed; for example: http://<serveripaddress>/test/cfpage.cfm.
The following figure shows the cfpage.cfm in the browser
As described in Chapter 1, ColdFusion processes all the instructions (CFML tags and functions) it receives on a page, and then returns the results of the instructions that your browser can interpret and display.