Home > Store

Core ColdFusion 5

Register your product to gain access to bonus material or receive a coupon.

Core ColdFusion 5


  • Sorry, this book is no longer in print.
Not for Sale


  • Copyright 2002
  • Edition: 1st
  • Book
  • ISBN-10: 0-13-066061-2
  • ISBN-13: 978-0-13-066061-9

The project-based guide to enterprise ColdFusion 5 development!

  • Develop serious applications with ColdFusion 5—fast!
  • Practical, project-based coverage delivers skills and code you can use right now
  • Database integration, Flash graphs, XML, wireless development, and much more
  • New ColdFusion 5 features: user-defined functions, query-of-queries, and data-driven graphs
  • Complete, working applications include an e-commerce site, a banner ad management system, a WML address book application, a site search, an intelligent agent, a ColdFusion 5 certification practice test, and much more!
  • Includes complete CFML tag and function reference
  • CD-ROM: 30-day evaluation copies of the latest Macromedia ColdFusion 5 products, plus an unrestricted copy of ColdFusion Express, and all source code

Core ColdFusion 5 is a relentlessly practical, project-focused guide to the specific techniques and skills you need to build serious enterprise applications with ColdFusion 5.

Certified ColdFusion expert Eben Hewitt walks you through constructing and integrating several increasingly complex, real-world applications. Every project delivers critical skills you'd otherwise have to learn through trial and error—and provides rock-solid code you can use in your own projects.

Hewitt's realistic "notes from the field" cut through the hype, helping you jump start your own projects—and build working systems fast. From the fundamentals of CFML to advanced database integration, to building a complete e-commerce site and XML-based content serialization, there's no better book for developers who just want to get the job done.

  • Preparing your ColdFusion environment and installing ColdFusion 5
  • CFML fundamentals: variables, templates, expressions, conditional logic, structures, arrays, lists, and functions
  • Designing and working with relational databases
  • Building a secure application framework and providing for state management and personalization
  • All of the new ColdFusion 5 features: user-defined functions, query-of-queries, and data-driven graphs
  • Deploying ColdFusion applications in wireless environments
  • Includes a complete ColdFusion 5 tag and function reference-plus step-by-step guidance on creating your own custom tags

The accompanying CD-ROM contains completely unrestricted copies of ColdFusion Express and Macrodmedia Flash Toolkit for ColdFusion, all of the book's source code, plus 30-day evaluation copies of all these Macromedia enterprise development tools:

  • ColdFusion 5.0 Enterprise Application Server for Windows, Linux, and Solaris
  • ColdFusion Studio 4.5
  • HomeSite 4.5
  • Macromedia Spectra 1.5 Application Framework
  • JRun Java Server 3.0.1 for Linux and Windows

Sample Content

Table of Contents



1. Getting the Lay of the Land.

What Is ColdFusion? What Can It Do for You? Why ColdFusion? What's New in Macromedia ColdFusion 5? What Difference Does the Macromedia Merger Make?

2. The World Wide Web and HTTP.

What Is the Internet? Application Servers.

3. Preparing Your ColdFusion Environment.

Operating-System Requirements. Hardware Requirements. Choosing a Web Server. Choosing a Data Server. Choosing a Version of ColdFusion 5. Getting ColdFusion 5. What's Next?

4. Installing ColdFusion 5.

Step 1: Checking Installation Requirements. Step 2: License Agreement. Step 3: Customer Information. Step 4: Web Server. Step 5: Choose Destination Path. Step 6: Choose Components to Install. Step 7: Assign Passwords. Step 8: Confirm Selections. Step 9: Install Files. What ColdFusion Installs on Your Machine. Troubleshooting Your Installation. Installing ColdFusion on Linux. Uninstalling ColdFusion.

5. ColdFusion Markup Language and Variables.

Introduction to the ColdFusion Markup Language. How to Begin. Your First ColdFusion Template. Setting and Outputting Rules.

6. Passing Data Between Templates.

What Is Scope? Scopes Available to ColdFusion. The CGI Scope. Conclusion.

7. Expressions, Conditional Logic, and Flow Control.

What Are Expressions? What Is Conditional Logic? Flow Control. A Complete Site Flow Control Framework.

8. Functions and Complex Data Types.

What Are Functions? User-Defined Functions. Working with Lists. Arrays. Structures. Putting It to Work.

9. Designing a Relational Database.

Three-Tier Architecture. What Is a Database? The Relational Database. Normalization. A Database Creation Script for Microsoft SQL Server. Tips for Writing a Database and Planning Your Web-Based Application. Conclusion.

10. Working with Relational Databases.

Data Manipulation Language. Connecting to a Database. ColdFusion Datasources. Creating a Datasource in ColdFusion Administrator. ,CFQUERY. Inserting Records. Updating Records. Deleting Records. Joins. GROUP BY. HAVING. A Complete Search Engine Application. Conclusion.

11. A Note about the ColdFusion Administrator.

Server. Security. Tools.

12. Loops.

What Is a Loop? The Query Loop. The Conditional Loop. List Loops. Looping over Structures. ,CFFLUSH.

13. ColdFusion Scripting.

How Does CFScript Work? Conditional Processing. Looping. Another User-Defined Function. Conclusion.

14. The ColdFusion Application Framework.

Defining the Application Framework. Session Variables. Client Variables. Server Variables. Error Handling. Logging Site Information with ,CFLOG. Creating a Personalized Web Page.

15. Graphing with ColdFusion.

Making a Simple Graph. Horizontal and Bar Graphs. Pie Graphs. Line and Area Graphs. Speeding Load Time with ,CFSAVECONTENT. Using ,CFGRAPHDATA. A Complete Data Drill-Down Graph Application.

16. Sending and Receiving Email with ColdFusion.

Sending Email. Sending HTML Email. Conclusion.

17. File and Directory Management.


18. Writing Custom Tags.

Advantages of Custom Tags. Disadvantages of Custom Tags. Creating a Simple Custom Tag. Passing Values into and out of Custom Tags. Making a Banner Ad Custom Tag. How ColdFusion Finds Custom Tags. Nested Custom Tags. Encrypting Custom Tags. Conclusion.

19. XML and ColdFusion.

XML. WDDX Datatypes. Serializing and Deserializing Data. WDDX in Action. Conclusion.

20. Creating Intelligent Agents.

CFHTTP. The GET Method. The POST Method. What Do We Do Now?

21. A Complete E-Commerce Application.

Store. Shop. Images. Queries. Checkout. Admin. Conclusion.

Appendix A: ColdFusion 5 Tag Reference.

Appendix B: Coldfusion Function Reference.

Appendix C: Common Errors and What to Do about them.

Appendix D: Getting a Coldfusion Job.

Appendix E: Getting Certified in Coldfusion.

Appendix F: Best Practices.

Appendix G: Wireless Coldfusion with Wap and WML.

Appendix H: Coldfusion resources, User Groups, and Hosts.

Appendix I: SQL Function Reference.




Core ColdFusion 5 is the book I wish I'd had when I began writing applications. One way of teaching programming is for the author to entice you, gentle reader, into the Technicolor landscape of the programming language at hand—the author is your friendly guide, pointing out the dazzling array of colors and scents, while you, the Maui-shirted, floppy-hatted tourist, peer dimly into your map as you stand gawking dead center at the intersection of 42nd and Broadway. You get your required caramel milkshake at Ellen's Stardust Diner and move on to stand in line for Cats tickets. Or something like that.

This is a different kind of book.

I learned ColdFusion on the fly—devouring websites and books devoted to the topic, nosing about in newsgroups and loitering on lists while I tried to get my first applications up and running. I learned by reading, by asking endless questions, by trying things over and over until something clicked. I learned from the generosity of hundreds of programmers it has been my pleasure to work with. I don't view it as an academic subject. This learning process was all very glamorous, but I think I wasted a lot of time that I didn't need to waste.

The approach is this: programmers are, above all, problem solvers. That's what they get paid to do. Therefore, the language is presented as a set of tools that are available to you to solve business problems. The code you will work with will consist of numerous non-trivial, practical examples that you can build on and incorporate into your own websites. My belief is that you can learn best how it all fits together by seeing it in action, working together. For instance, it's fun to learn about cookies, and it's great to know that by using the CFLOCATION tag in your templates you can quickly jump to another URL. This is the sort of thing one learns as a programming tourist. Only when discussing a real-world application where all the parts have to fit together do you discover that, because of HTTP headers, you can't effectively set a cookie in the same template that you use CFLOCATION to get out of. But that's exactly the sort of thing you need to know when you sit down to write ColdFusion.

You are a person in the world where people live. This indicates a certain relationship with space and time. This book was designed with these key factors in mind. There is only so much space in a book, so what you've got in your hands is the set of tools with which to continue on your own: There's the complete tag and function reference. There are lists of dozens of websites where you can get ColdFusion code, find more information on related topics, discover hundreds of places where you can host your ColdFusion website, and more. You get a list of the common ColdFusion errors you'll run into when debugging your applications, what they mean, and how to fix them. You put together a ColdFusion application for Web-enabled cell phones and a working e-commerce site, complete with rotating banner ads.

The idea is to save your walls from the repeated impact of your head. This book will give you everything you need to get up and running quickly, effectively, and with an understanding of the real-world implications of developing with ColdFusion.

The remainder of this preface briefly illuminates key things you will need to start using this book, and ColdFusion, quickly.

Who You Are

This book was written for anybody who wants practical knowledge of how to make Web applications on an easy, scalable, powerful platform.

You know HTML already. You do not need to know another application programming language. You do not need knowledge of Web servers or data servers.

Maybe you know ASP or JSP and want to learn another language. This book is perfect for you. Maybe you just took an IT job at Symantec or Doctor Solomon's or Bank of America or the University of Utah or the Recording Industry of America. Or maybe you were just elected Senator of your fine state, and, while browsing at http://www.Senate.gov noticed the little ".cfm" extension on your website and wondered what it was. All of the above organizations entrust their Web transactions to ColdFusion. And with good reason.

This book was also written for Web developers and for people who have done a static website or two and want to make their next one dynamic. The ability to create an online store, to interact with data warehouses via enterprise-level features such as stored procedures and data probing, lets you get really serious. The ability to personalize your website, catering its content to each individual visitor, will allow you to create truly compelling relationships with your users. The ability to search and share documents in just about any format will allow your organization to stay ahead of the information cycle.

Project managers and sales engineers will benefit from this book's discussions of planning an enterprise-level website and making all of the components come together.

Despite a seemingly universal predilection toward Mountain Dew, Web programmers are a diverse species. Whether you are a pleasantly dressed co-ed working in a college computer lab with well-modulated air, or if you're grinding out 18-hour days in a high-tech job shop and have recently started looking like the long-lost fourth member of ZZ Top, or whether you're all by yourself in your basement playing gladiator with IIS and scramming the cat from chewing your cables, this is the right book for you.

What You Need

You will need several things to work successfully through the exercises in this book. You will need a computer with a text editor. You will need access to ColdFusion Server 5 software, a Web server, and an Internet connection. A 30-day evaluation version of ColdFusion 5 comes on the CD-ROM with the book, Notepad or Pico comes with your OS, and Apache is free, so you're in pretty good shape.

What You Get

This is a practical book. Its purpose is to answer the questions you need answered by showing you how everything works together (HTTP 1.1 headers, the Web server, your applications, conditional logic, and so forth). Some of this may be old hat to you. I have therefore tried to flag you about beginner material that you may want to skip.

Here is what you get:

  • A clear, detailed explanation of the ColdFusion language and how you can leverage it to build fantastic Web applications.
  • Information, tips, and tricks about becoming a ColdFusion Certified Developer.
  • Thousands of lines of complete, working code.
  • On the CD-ROM, you get 30-day evaluation versions of Macromedia ColdFusion Enterprise Server 5.0 for Windows, HP-UX, Sun Solaris, and Linux; ColdFusion Studio 4.5.1 (the optional development environment for creating ColdFusion templates); HomeSite 4.5.1, Macromedia's award-winning HTML editor; The Harpoon Flash Toolkit; ColdFusion Express, the nonexpiring, limited-functionality product for serving ColdFusion pages; JRun 3.0.1, the award-winning server for Java Server Pages, Servlets, and Enterprise Java Beans; Macromedia Spectra 1.5 for Windows and Sun Solaris, the packaged application solution for content management, e-commerce, and personalization—written in ColdFusion!
  • A website companion to the book filled with even more ColdFusion resources. The website is located at http://www.CoreColdFusion.com. Check out http://www.conditionallogic.com as well.

How This Book Is Organized

This book begins where HTML left off. We start with an overview of how the Internet works and an overview of what ColdFusion does. We then move into a discussion of SQL (the Structured Query Language), the language used to create and manipulate databases and their data. If you have a solid understanding of relational databases and SQL, you can probably skim Chapters 9 and 10.

Each chapter will have roughly the same structure. You will be introduced to the key concepts in a general way, and quickly move into details as they pertain to ColdFusion or application development. You'll come out of most chapters with a working example that you can take with you.

Because each chapter builds on the last, it is a good idea to read the book from beginning to end. If you're used to programming in another Web application language such as PHP, you might want to at least skim the introductory chapters on the World Wide Web and HTTP, as well as the SQL chapters, just so I don't make unfortunate assumptions.

As the book continues, and you've got the key concepts and a number of tags and functions under your belt, we'll start putting together bigger applications with a number of pieces that have to fit together. That is the only way you can learn how to work with ColdFusion in large-scale websites.

Many of the examples in this book were created with the ColdFusion Application Server running on a Windows 2000 with IIS 5. The database used in most cases is Microsoft SQL Server 2000. Oracle 8i is used in some examples. Access has generally been eschewed because, while it is inexpensive and therefore easier to get hold of, it is desktop software and unsuited to a production environment. You can make most of the examples in this book work with Access or Paradox with little or no modification. You can even use Excel spreadsheets and plain text files with some modification. That's a fabulous aspect of ColdFusion, and just one demonstration of its flexibility. However, I try to discourage the use of desktop database software with ColdFusion for applications that are likely to have more than a couple of concurrent connections or any frequency of use.

About the Website

If you point your browser to http://www.CoreColdFusion.com, you will discover the companion website to this book. It is meant to provide you with a resource for taking your applications to the next level and continuing your work.

Some features of the website include:

  • Databases, files, and code from the book
  • Code for creating the website
  • Enhancements and expansions to discussions in the book
  • Links to ColdFusion hosting providers
  • Resource links for ColdFusion User Groups and the most useful ColdFusion sites on the Web
  • Information about becoming a Macromedia ColdFusion Certified Developer
  • A newsletter with product and informational updates on ColdFusion and Spectra
  • A forum for reader feedback—tell me what you think!
  • A schedule of ColdFusion and Spectra training seminars happening every month, all over the United States
  • Fun things like the ColdFusion challenge—a compendium of tips and tricks
  • Security bulletins

If I've done my job, this book will teach you what you need to know about ColdFusion in order to go do it in the real world. Hopefully it will also prove useful long after you know what you're doing—it has been organized to serve also as a reference. It's got the complete language in it, updated for ColdFusion 5. And it's got working examples that represent the most commonly needed tasks in Web programming today.

You can give me feedback at writer@CoreColdFusion.com. I welcome your comments and suggestions for future editions.

Thank you for picking this up. I really hope you like it.


Submit Errata

More Information

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information

To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.


Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.


If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information

Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.


This site is not directed to children under the age of 13.


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information

If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information

Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents

California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure

Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact

Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice

We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020