1. Home
  2. Computing & Technology
  3. Web Design / HTML

Beyond CGI to ColdFusion

Learn to Use ColdFusion to Create a Dynamic Site

By Jennifer Kyrnin, About.com

While you may be comfortably creating your Web pages and CGIs using HTML, JavaScript, and Perl, how long did it take you to get conversant in those technologies? ColdFusion is so easy to use you can have a database driven site up in about two hours, even if you know no SQL and have only a small data store to build from. ColdFusion gives you all of the benefits of CGI plus easy database access and simple to create forms and dynamic pages. The other nice this is that while ColdFusion Studio creates the ultimate environment for writing CFML pages, you can use any text editor or HTML editor that allows you to input custom tags.

Last week, in Beginning HTML, we learned how to create a form to email HTML form that used the "mailto" command to force the default mail client to send the form information as mail. Here is how you would do the same thing with ColdFusion:

The Form Page (e.g. form.html)

<FORM ACTION="formpage.cfm" method="post">
Name: <INPUT TYPE="TEXT" NAME="name" SIZE="30"><BR>
Email: <INPUT TYPE="TEXT" NAME="from" SIZE="30"><BR>
Please rate my site from 1 to 10 (1 = bad and 10 = good): <BR>
<SELECT NAME="rating"><BR>
<OPTION>1
<OPTION>2
<OPTION>3
<OPTION>4
<OPTION>5
<OPTION>6
<OPTION>7
<OPTION>8
<OPTION>9
<OPTION SELECTED>10
</SELECT><BR>
How would you suggest I improve it?<BR>
<TEXTAREA NAME="improve" ROWS="5" COLS="30"></TEXTAREA><BR>
<INPUT TYPE="SUBMIT" VALUE="Send Feedback"> <INPUT TYPE="RESET"></FORM>
</FORM>

The Results and Processing Page (formpage.cfm)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<cfmail to="html.guide@about.com"
from="#from#"
subject="form results"
server="smtp.server"
port="25">
name: #name#
email: #from#
rating (1-10): #rating#
suggestions: #improve#
</cfmail>

<html>
<head>
<title>Thank You for Filling Out the Form</title>
</head>

<body>

<h2>Thank You for Filling Out the Form</h2>

We appreciate the time you've taken to give us quality feedback.
</body>
</html>

ColdFusion, with just a few new tags, CFMAIL and .cfm, does the same thing as the mailto form, but it also adds a customizable thank you page, so that your readers know that their information was collected.

But there is so much more. You can do more than just collect the form results in an email. You can save them to a database with just a few basic SQL calls. And you can even create a dynamic page from that database. If you are looking to create a dynamic, data-driven Web site quickly and easily, then ColdFusion is the way you should go.

It is compatible with Windows and Solaris and both Apache and IIS. In fact, for one test situation, I ran ColdFusion server on a Windows 95 machine running Apache, and had no problems. Allaire tells me that they will have a version for Linux out shortly. When you combine ColdFusion server with ColdFusion Studio, then you get a truly powerful solution.

Previous Features

Explore Web Design / HTML

More from About.com

  1. Home
  2. Computing & Technology
  3. Web Design / HTML
  4. About.com Web Design A to Z
  5. Books
  6. About Web Design Book
  7. AWD: Chapter 14
  8. Beyond CGI to ColdFusion: Learn to Use ColdFusion to Create a Dynamic Site

©2008 About.com, a part of The New York Times Company.

All rights reserved.