Cold Fusion

What is Cold Fusion ?
  • ColdFusion is one of the easiest programming environments to use, and enables us to create powerful server-side web applications very quickly, with much less code than other technologies such as ASP, PHP etc.
  • ColdFusion integrates many Internet technologies such as XML, Java, web services etc, and as such, our applications can be as small or complex as required.

History of Cold Fusion ?
  • The software was created in 1995 by the Allaire Corporation, originally located in Minnesota.
  • Adobe acquired Macromedia in 2005 and is still actively developing ColdFusion.

What Can ColdFusion Do ?
  • Query a database
  • Allow users to upload files
  • Create/read files on the server
  • Present a customized experience 
  • Send emails 
  • Schedule tasks to run automatically 
  • FTP files to/from another server
  • Publish web services..etc.

Pro's of Cold Fusion : 
  • Rapid Application Development
  • Easy to understand syntax
  • Tons of built in features
  • Cross-platform.

Con's of Cold Fusion : 
  • Expensive
  • Limited career prospects
  • Very few applications written in it.
  • Has overwhelming competition it can never hope to rival.

Setup & Installation : 
  • Go to official website of adobe cold fusion and click on download for trial version.


  • Double click on the downloaded setup file.


  • Click on next.


  • Accepts the terms and choose the server configuration and click on next.


  • Select the sub components and click on next.


  • Enter the username and password for remote administration.


  • Choose the path, web server and click on next.


  • Enter the port number, username and password. 


  • Click on install.


  • Click on done.


  • Program to print hello coldfusion.

Basic concepts in ColdFusion : 
Variables : 
  • A variable can be visualised as a container that stores a value. 
  • To set a ColdFusion variable, use the <cfset> tag. To output the variable, you need to surround the variable name with hash (#) symbols and enclose it within <cfoutput> tags.

If Statement :
  • A conditional statement is a piece of code that does one thing based on one condition, and another based on another condition. 
  • With If statements, we can tell the ColdFusion server to execute a piece of code only if a given condition is true.


ColdFusion Loops (cfloop) :
  • A ColdFusion loop is a block of code that executes continuously either a specified number of times, once for each element in an object, or while a condition is true.
  • In ColdFusion, we use the <cfloop> tag to perform a loop. The <cfloop> tag has a number of different attributes. The attributes used depends on the type of loop we're performing.


ColdFusion Lists : 
A ColdFusion list is simply a string. The thing that makes this string different (to any other string) is that it contains delimiters. Delimiters (sometimes referred to as separators) are used to separate each item in the list.

FunctionsDescription
listLen(coldfusion_list)To find out the list length
listAppend(coldfusion_list, "ColdFusion Functions")Add an item to the end of the list
listPrepend(coldfusion_list, "ColdFusion Functions")Add an item to the beginning of the list
listInsertAt(coldfusion_list, "2", "ColdFusion Functions")Add an item somewhere in the middle of the list
listContains(coldfusion_list, "ColdFusion")Find out if the list contains a given string
ListToArray(coldfusion_list)Convert a list into an array
ArrayToList(array_name)Convert an array into a list

ColdFusion Arrays : 
An array is simply an ordered stack of data items with the same data type. Using an array, you can store multiple values under a single name. Instead of using a separate variable for each item, you can use one array to hold all of them.

Function : 
  • A function is a self contained block of code that performs a given 'function', then returns a value. Often, a function will require that you pass it one or more arguments. 
  • The purpose of an argument is to provide the function with further info that it needs in order to process. This info could be different depending on the context in which the function is being called.
  • We can either build your own functions, or use one of ColdFusion's built-in functions. ColdFusion has over 250 built-in functions ranging from string-manipulation functions, date functions, array functions, mathematical functions and many more.
  • To use a ColdFusion function, we write the function name, followed by opening/closing brackets. Any arguments that we pass to the function goes between the brackets.
  • Syntax : functionname(parameter1, parameter2,...).