Understanding Coldfusion

I l @ ve RuBoard

ColdFusion comes in two parts : ColdFusion Studio and ColdFusion Server. You create your pages in ColdFusion Studio, and you use a ColdFusion server to process these pages.

ColdFusion is very different from HTML, though the languages share some characteristics. They're both tag-based languages, and both are used to display pages in a Web browser. But there the similarities end. HTML can display only static data ”information that doesn't change. ColdFusion can be used to display dynamic information ”results that change in response to some event or user interaction. For instance, dynamic content allows you to create pages that display information based on users' requests , run an online store, process orders, and interact with users, customizing information to meet their needs.

Dynamic content keeps users coming back to your site. When users see that nothing changes on a page they visit, they are not likely to return to it. However, if you keep the content fresh and give people a reason to come back, they will be more likely to point their browser to your site again and again. Think of the sites that you visit. Why do you go there? You probably go to them for information. News sites and financial sites that offer stock quotes are some of the most heavily trafficked sites on the Web, because they offer current, frequently changing content. Keeping your site's content fresh is easy with ColdFusion.

With HTML, when a client ”usually a Web browser ”requests a page, the Web server gets the request and returns all the HTML code and images associated with that request to the client. The client then displays the results of the HTML code, along with the images. With ColdFusion, when a client requests a page, the Web server hands the page to a ColdFusion server and waits. The ColdFusion server processes the template; querying databases, performing calculations, using conditional processing, or doing whatever else is specified. Then the ColdFusion server generates the necessary HTML and sends it back to the Web server, which in turn sends the page back to the client for display. With this one added step and some extra code, you can turn your site into something more than just words and pictures.

Want to see a ColdFusion page in action? That shouldn't be hard to do; they are everywhere. One live one that's easy to find is at http://www.allaire.com. When you look at this "front page," you are actually accessing a page called www.allaire.com/index.cfm. (The .cfm extension means it's a ColdFusion page.) The next time you're surfing the Web, look around and see how many of these you can find.

NOTE

Allaire, the company that created ColdFusion, was acquired by Macromedia in March of 2001. At the time of this writing, the Allaire Web site had not been merged with Macromedia's site. However, if you can't find it, try going to www.macromedia.com.


NOTE

The site won't look exactly like the image you see here. Why? Because, of course, it uses dynamic content and is constantly changing.


While you're looking at the Allaire page, take a look at the source code for that page. (In Internet Explorer, choose View > Source; in Netscape Navigator, choose View > Page Source.) It looks just like an HTML document! This is because the ColdFusion server generates the HTML for the page while processing the ColdFusion-specific tags. If you were to look at this page without knowing that it was written with ColdFusion, you might assume that it was a static HTML page, but it's not. What you cannot see are all the ColdFusion functions that are used to create the page ”the database queries, output, variables , functions, and so on. By generating HTML on the server side, ColdFusion does not have to worry about browser incompatibilities, because every browser can read HTML.

But let's get started. Before we dive into any part of the program, we need to install it, and a few other vital components as well.

I l @ ve RuBoard


Macromedia ColdFusion 5. Training from the Source
Macromedia ColdFusion 5 Training from the Source (With CD-ROM)
ISBN: 0201758474
EAN: 2147483647
Year: 2002
Pages: 99
Authors: Kevin Schmidt

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net