Search Altered Pixels.net::

ColdFusion Tutorials ::

Tutorials in using ColdFusion
  • ColdFusion Application Mappings and Sub-folders

    Posted on :: Jul 23

    I've started leveraging some of the ColdFusion goodness into my applications.
    The first thing I have implemented is application level mappings to keep my configuration files and components out of the web root. Here's how my current project layout rolls.

    [Read more →]

  • Online Editor for ColdFusion 9

    Posted on :: Jun 10

    I've created an online web editor to test ColdFusion 9 tags and functions. Although it has limitations of testing only basic tags. File operations, database operations won’t work that are dependent on the server path and properties.

    [Read more →]

  • Using jQuery Autocomplete to Populate Another Autocomplete

    Posted on :: Jun 8

    This example will use a jquery autocomplete to choose a state then, based on the state, another jquery autocomplete will be populated with zip codes for that state. Basically, the state chosen gets used as a filter in the query for the second autocomplete. I've included example for this tutorial in .NET, ColdFusion and PHP to show just how easy it is and compare the differences between the languages, asnd uses SQL Server for it's Database...

    [Read more →]

  • Creating Dynamic thumbnails of URLs in ColdFusion

    Posted on :: Jun 7

    I've been exploring to see whether ColdFusion could handle making thumbnails of Websites, similiarly to how PHP can, through the use of the CFIMAGE tag. Well, I discovered not only does it, but It does it even easier than PHP!

    [Read more →]

  • Calculating Relative Date & Time Differences Using ColdFusion

    Posted on :: May 24

    I've always appreciated how many social networking sites like Facebook display date/time stamps for status updates. Instead of simply dumping out a date and time, they calculate the relative difference from the time the status update was made to now. This is extremely useful because 3 hours ago means a heck of a lot more to me than May 14, 2010 5:41 AM.

    Calculating date/time differences has always been easy in ColdFusion, but generating a string like this would probably require a tiny bit of work.
    * Calculate the date and time difference between a date and now.
    * Use the most appropriate unit of measure based on the difference (minutes, hours, days).
    * If the difference isn't exactly (for example) 1 hour, display the word "About" to indicate the difference is not exact.

    [Read more →]

  • Avoid Caching CSS Files with ColdFusion

    Posted on :: May 24

    Every now and then, when I push changes to a css file to a production server, I'll have to refresh once or twice in order to see the changes take place. This typically isn't a big deal for me because I know the css file is just cached. Clients on the other hand have a hard time accepting the fact that they "just have to refresh a few times" to see the updates. In the meantime, clients and visitors may experience a completely borked website until the cached css file drops out of their cache, and their browser snags the new file. The good news is there is a very easy way avoid caching your css files.

    [Read more →]

  • ColdFusion with jQuery - Login & Session Timeout

    Posted on :: May 3

    In this tutorial I'm posting my solution for two very important Items I've been working to develop together, Coldfusion/JQuery Ajax Login, and a Coldfusion Jquery Session Timeout Monitor.

    It just so happens that you can acheive both, with minimal coding, as it happens, and successfully accomplish both an Ajax-based Login form, and a Session time out System, both with Coldfusion and JQuery.

    [Read more →]

  • JQuery Username Check Tutorial

    Posted on :: Jan 8

    In this tutorial, I'm going to show you how easy it is to create a username check utility directly inside your web-based form, using JQuery & ColdFusion.

    [Read more →]

  • Using JQUERY to Detect an End of Session event

    Posted on :: Nov 13

    With AJAX applications giving us a lot more power than an "old school" web 1.0 page, it isn't unusual for someone to just sit on one page and fire off various operations that use HTTP to fetch and present data. This works fine until you leave the site alone for too long and your session times out. (I'm assuming most folks use a time based session, much like how ColdFusion works.) The question is - what happens in your current AJAX based application when a user's session times out?

    There is a solution...

    [Read more →]

  • Generating an RSS Feed using CFFEED

    Posted on :: Oct 16

    This Tutorial Will show you how to generate RSS Feeds from a Database Query and have those feeds made into a Compliant RSS 2.0 Feed Requires ColdFusion 8, will not work on earlier version of Coldfusion.

    [Read more →]

  • Optimizing and Backing-up a MySQL Database in Coldfusion

    Posted on :: Oct 15

    If you're working on databases and want to either Optimize of Backup your Database, you should automatically optize all the list of tables and then back it up.

    [Read more →]

  • Flexigrid :: ColdFusion and JQuery

    Posted on :: Sep 21

    For a great while now I've been attempting to use and or create a JQuery-based Grid System for several projects I'm working on. I've tried many including jqgrid (and could never get jqgrid working for some reason), but I stumbled upon Flexigrid.

    Flexigrid is a Lightweight but rich data grid with resizable columns and a scrolling data to match the headers, plus an ability to connect to an xml based data source using Ajax to load the content.

    [Read more →]

  • Looping over a Structure (without knowing it's Keys) in ColdFusion

    Posted on :: Sep 4

    I'm currently in the process of bilding a Dynamic Form Building Application in ColdFusion, and was having issues with getting the values of my Submitted Structure. I wasn't able to read the structure accordingly (becuse I had though originally it was an array, only to fnd through CFDUMP is was being saved as a Strcture).

    So I thouht I'd give you this little snipplet of code to help you out, as It did me:

    (TWO EXAMPLES AVAILABLE)

    [Read more →]

  • SEO URLS with CFScript

    Posted on :: Sep 2

    This is yet another way to take care of SEO URL rewritting, this one how is encompassed in CFSCRIPT.

    It is better to be used with Application.cfc rather than Application.cfm, however I'll cover Application.cfm below.
    This CFScript allows you to write urls like:
    http://www.yourdomain.com/index.cfm/variable1/value1/variable2/value2

    And you can do this seamlessly if you already have traditional links in place, it will not affect:
    http://www.yourdomain.com/index.cfm?variable1=value1&variable2=value2

    (they are interchangeable)

    [Read more →]

  • Collecting User Statistics with JavaScript, and ColdFusion

    Posted on :: Aug 28

    This tutorial shows you how to gather and store user statistics, including Browser, Browser Version, Screen Width, Color Depth, Screen Height, Bit Rate and User Environment. Includes Browser Detection for IPhone, Blackberry, and Android-based mobile devices...

    [Read more →]

  • SEO URLS via ColdFusion

    Posted on :: Aug 28

    In this tutorial, I'm showing you a working method for URL Rewriting using ColdFusion, and a ColdFusion CFC.
    You'll be able to have your old urls like: http://yoursite.com/index.cfm?var1=1&var2=2
    to be viewed and displayed as: http://yoursite.com/index.cfm/var1/1/var2/2/

    [Read more →]

  • Using Coldfusion to Import CSV Files

    Posted on :: Jul 29

    Using Coldfusion to Import data into mySQL

    Many times we need a quick and easy way of importing data into our website databases. The CSV file format is one of the defacto standards for moving data between databases easily. Virtually all databases allow exported to CSV format. And virtually all database support importing a CSV formatted file. So why use Coldfusion to do this mundane task? Simply put it is database independant - in this example I created a simple script that reads a CSV file and inserts the records into a matched mySQL table. When I first started looking at this I was surprised that I could find very little of how to achieve this. So now that I have it worked out I thought I could share this little piece...

    Lets set the stage:

    [Read more →]

  • Passing JavaScript Values to Coldfusion

    Posted on :: Jul 21

    Is it possible to pass JavaScript Values to ColdFusion? Not directly no, as JavaScript is a Client side Language and ColdFusion is a Server-side Language. It can be done, however not without refreshhing your Page and.or Form.

    This tutorial will show you one possible method of sending a JavaScript variable to coldfusion via using the url.

    [Read more →]

  • Building an Editable Grid with AJAX and ColdFusion Components

    Posted on :: Jun 23

    In the past few months, the design pattern of combining Asynchronous JavaScript and XML (AJAX) to develop highly interactive Web applications has been growing in popularity. The individual technologies that compose AJAX are not recent developments; they have been around for some time and have been continuously updated and improved. However, it is the recent confluence of these technologies that is leading to interesting possibilities.

    A common data editing interface consists in: an HTML table showing a list of database records. A form where you can edit each record. And some action pages to update, insert and delete records. In other words, when a user wants to change some data, there are a lot of navigation and page reloads involved.

    In this tutorial, we will change an HTML table into an editable grid. That is, we will automatically create a form from grid cells using JavaScript and call some ColdFusion component methods - using AJAX - to update information.

    [Read more →]

  • cfimage generating unreadable CAPTCHAs

    Posted on :: May 12

    While Playing a around building a new page for a form that required a CAPTCHA to prevent spamming, I thought: I'd use ColdFusion 8’s <cfimage> tag; which I did, and it was really simple to do.

    I realized that the Captcha images weren't readable, or murky or distorted. And then it hit me: the problem was that the page had a black background; the generated CAPTCHA images had an alpha-transparency background – and so the black was showing through, and making everything dark.

    [Read more →]

  • Creating Stand-Alone ColdFusion Templates With Embedded Images

    Posted on :: Apr 29

    This isn't as cool as perhaps it sounds, but it's kind of neat! Here's the Scenario:
    You (or the project you're working on) don't want images on it to have to be stored in the standard file system. This makes the page extremely modular so that I can just drop it in and not worry about taking it out later.

    [Read more →]

  • Automatically Adding Smiles To Your Messages

    Posted on :: Apr 23

    This tutorial will demonstrate how you can implement smiley's  into your pages on the fly.

    [Read more →]

  • (x)html Compliant Dynamic Columns Display

    Posted on :: Apr 23

    There's always alot of methods for displaying a Table's rows and Columns, dynamically, however this tutorial will show yu how to do it with XHTML Complaince.

    [Read more →]

  • Configuring CF8 to use Google Apps

    Posted on :: Apr 21

    The biggest issue I have with running my own server is dealing with spam blockers, email servers, DNS servers, etc. For some of you this is easy, and a no brainer. I personally run from it like a screaming banshee. I use google hosted services for all my email needs. They make it easy, rarely ever have downtime, and the spam filtering is second to none!

    Google works fine for sending email from my desktop mail client or through the web, but sending mail via scripts programatically has always been a pain in the butt in my experience. That is until today.

    [Read more →]

  • Google RESTful Ajax » JSON Search in ColdFusion

    Posted on :: Apr 15

    A Friend of mine was hacking and cursing his way through a routine to convert RSS feeds in to HTML, I had an idea. I thought, "Wow, maybe there's another way to do this ..." Converting RSS can be messy so I opted for a much easier and cleaner solution ... JSON. For those Ajax pros out there ... have a heart ... I'm definitely a nOOb at JSON ... I just wanted to share my experience because the introduction and experience was enlightening ... at least to me it was.

    [Read more →]

  • Creat a ColdFusion collection with the cfcollection tag

    Posted on :: Mar 31

    On occasion a developer may not have access to ColdFusion Administrator, for
    example, if you use a virtual hosting company. If you want your ColdFusion
    application to be able to create, delete, and maintain a collection you will
    need to use the cfcollection tag. The following will show you how to create a
    collection index it then index it to include a MS Access database this code
    works great for use with a serch function for your shopping cart site. You will
    need to create an Access database with a table named Products and you will need
    the following fields ItemID, ProductID, ProductName, BriefDescription, Details.

    [Read more →]

  • Understanding and Using CFCs (with OOP and database interaction)

    Posted on :: Mar 31

    First off, this is a rather long and detailed tutorial. In this tutorial we will go over the basics of creating CFCs. This tutorial was created mostly in part because it seemed to me there was a very limited number of articles and tutorials addressing the subject of practacle CFC development.

    I will be using a number of terms in this tutorial that are common in the world of Object Oriented Programming (or OOP). Even though CFCs do not share all aspects of objects in true OOP languages, we can benefit by using those aspects that are available.

    [Read more →]

  • Using ColdFusion's CFDBInfo to Dynamically Output Database Columns and Tables

    Posted on :: Mar 23

    The ColdFusion tag CFDBInfo was introduced in ColdFusion 8. I finally got around to playing with it and thought someone other than me might find this useful. I was thinking of using it for creating a dynamic SQL dump for some of my projects I'm currently writting, and thought I should share it with the world.

    There are a ton of uses for this excellent CF Tag, and I've included a few samples below.

    [Read more →]

  • Creating PDFs that automatically print via CFPDF and DDXCreating PDFs that automatically print via CFPDF and DDX

    Posted on :: Mar 23

    Here's the situation. A user is viewing a report online. The business owner of the application decided to provide a nice PDF format of the data, all the user needs to do is click a button, perhaps named "print". The CF server generates the PDF, hands it off to the browser through either CFLOCATION or CFCONTENT. So now the user has the PDF loaded in a secondary window and have to go hunt for the print button again. But fear not, dear user! We'll save you by judicious use of XML, Javascript, and ColdFusion.

    [Read more →]

  • URL Rewritting in Coldfusion

    Posted on :: Mar 12

    In my endeavors to optimize the projects and sites I've worked on, I developed a simple snipplet of code that will easily adapt your long urls into an easier to remeber and easier to use method.

    [Read more →]

  • File upload gotcha: PDFs get different mime types per browser

    Posted on :: Mar 11

    When you upload a PDF in IE, the file you receive has what I believe is the correct mime type: "application/pdf" however when you upload the same PDF file using the same code, in Firefox (tested in FF 2 and 3), the mime type is "application/download". I can't explain it. I have no idea why it's wrong. But it is, and consistently so. Could this be the one thing that is implemented correctly in IE and incorrectly in Firefox?

    [Read more →]

  • Easily Cache the Return Value of Any Function

    Posted on :: Mar 9

    Work in web development long enough, and you'll run into caching. When done appropriately, it can be a real life saver. In CFML, we have several caching tools at our disposal.

    The built in cfcache function will cache an entire page, and there are a bunch of projects on RIA Forge (search for "cache") that deal with caching of whole pages, partial pages, and specific data; and use various methods from memcached to underlying java caching. And of course, you can always roll your own cache using a persistent scope (application, session, client, or cookie) and some date comparison.

    After about the 100th time of rolling my own custom caching, I decided it was time to wrap it up in a nice little UDF.

    [Read more →]

  • ColdFusion Export to Excel

    Posted on :: Mar 7

    [Read more →]

  • Catch dynamically created form values

    Posted on :: Feb 13

    When you dynamically create a list of form elements it is sometimes hard to catch the values of those forms to use for database insertion. This tutorial describes how you can do this.

    [Read more →]

  • E-Commerce in ColdFusion

    Posted on :: Feb 12

    This tutorial uses arrays and structures to develop a shopping cart system. This tutorial also contains web-front order processing (e-commerce) information that most of you will probably find very helpful alongside the shopping cart.

    This tutorial comes from an eclectic group of sources. I utilized Macromedia's LiveDoc's, CJ's tutorials, as well as many other tutorial information when I first built a full shopping cart system. With that in mind, some of my coding may seem familiar from elsewhere, and I want to acknowledge that I took parts of my coding from other sources when I initially wrote all of this coding. At this point I cannot cite exactly which parts are from elsewhere, but just know that some parts are.

    Additionally, this tutorial utilizes a processing system in which people who shop must sign up as members. The coding is written so it is not a nuisance for customers to sign up as they check out. The code should be easily understood and editable so customers do not have to sign up before purchasing. I did this because I have found it more convenient for customers to store their information, and its more secure as it only uses one address for both billing and shipping.

    [Read more →]

  • Dynamically Generating HTML Table Columns & Rows

    Posted on :: Feb 12

    I've written this tutorial, because I had a need to do exactly what the title suggests. I needed to dynamically generate a table with Columns and Rows, based off of a CFQUERY results. Well, this is the fruit of my labors, and I hope it assists others as well.

    [Read more →]

  • Displaying Tag Restrictions on ColdFusion Server

    Posted on :: Feb 12

    Please Note: This Tutorial is for Cold Fusion running on Windows.

    One thing that always got to me was that on shared coldfusion hosting, you wouldn't know what restricitons are on the server until you try to run a chuink of code, like <Cfdirectory> and get an error. Well I've written this tutorial to assist you in ascertaining which tags are permitted and which aren't.

    [Read more →]

  • Creating IIS Virtual Directories with Coldfusion 8 and .NET

    Posted on :: Feb 10

    Ever had a need to automate the creation of virtual directories in IIS? Coldfusion 8 can do this quite well using the System.DirectoryServices.DirectoryEntry class in the .NET framework.

    [Read more →]

  • What if you could run PHP code directly inside ColdFusion?

    Posted on :: Jan 7

    I found this blog post back in early 2008 that states you can run PHP (and Ruby) on Coldfusion 8. I thought this was pretty damed cool, especially considering I develop with both. So here's the Blog entry:

    What if you could run PHP code directly inside ColdFusion?

    [Read more →]

  • Preventing SQL Injection

    Posted on :: Nov 17

    Most web applications interact with a database, and the data stored therein frequently originates from remote sources. Thus, when creating an SQL statement, you often use input in its construction. A typical SQL injection attack exploits this scenario by attempting to send fragments of valid SQL queries as unexpected values of GET and POST data. This is why an SQL injection vulnerability is often the fault of poor filtering and escaping, and this fact cannot be stressed enough.

    I'm going to explains SQL injection by looking at a few example attacks and then introducing some simple and effective safeguards. By applying best practices, you can practically eliminate SQL injection from your list of security concerns.

    Preventing SQL Injection in PHP & Coldfusion

    [Read more →]