Posted by i_am_geek on Aug 1, 2011 in ColdFusion, Programming | 2 comments
In reply to this post , here is how I got started in ColdFusion:
I first got started in ColdFusion at my first full time web position. I created a craigslist post basically saying I would work any company that would have me (lol) and sure enough, 1 month later I was working as a web developer. When I started my boss told me that they used ColdFusion and I would have to learn it. Previous to this I had some limited PHP knowledge but no real development chops…that changed real quick. Soon after learning the basic structure of the language, I was handling my own projects and really learning all that ColdFusion had to offer.
We offered a CMS that could be customized based off the customers site/requirements and this really helped me learn how to read existing code and learn to update it. The most common task we did was generating reports, so I became very familiar with exporting pdf’s and excel documents on the fly.
Fast forward 3 years and I have become the developer I am today. I run a successful web development business specializing in rapid development using ColdFusion. I have created my own custom CMS that I implement on most of my sites and with the new features available in ColdFusion 9, this really has become a great piece of software. I owe a lot to ColdFusion and any chance that I get, I tell people about it.
read more
Posted by i_am_geek on Jun 7, 2011 in ColdFusion, geek, PHP, Programming, Rant | 1 comment
As part of my online classes, we participate in weekly discussions on various topics. This weeks was about:
1. The difference between a server-side language (such as CFML), a server-side platform (such as Adobe ColdFusion Server), and a server-side development framework (such as CFWheels).
2. The inherent statelessness of server-side applications, and how some platforms work around this statelessness using tricks such as Sessions.
3. The pros and cons of at least two server-side platforms or languages.
I got a lot of nice remarks on my post, so I figured I would share it:
There are many differences between a server-side language, like ColdFusion, a server-side platform, like Adobe ColdFusion Server and a server-side framework, like CfWheels. The server-side language is the language the server processes and what you will be using when creating your pages. Server-side languages need a server to process the language and that is what is called the server-side platform. When you use the server-side language of ColdFusion, your server-side platform will be Adobe’s ColdFusion Server. This is what you install on your web server to run your pages. Most languages have what are called Frameworks. What these essentially are is a group of pages that someone else created, that you can use in your source to make things easier. Certain things are already done for you and you essentially just have to plug in your data and the framework displays/updates the data with prewritten code.
I have used Coldfusion (version 5-9) for the past 4 years and couldn’t be happier. The rapid development times alone should be reason enough to check this language out. With a huge library of tags built into the language, you can create the code to do many advanced functions in just a few lines. Now the main complaint the ColdFusion community (which is huge, helpful and always growing) hears from the PHP Community is the price of ColdFusion. Now the server costs are more than what people are expecting to pay, which is $0 but you have to think of that initial cost as an investment in the language. There are many posts proving this (Link – which shows even more great reasons to use ColdFusion) and as you will see, the time you save learning the language, developing the app, and then the time saved on maintenance and support, shows that ColdFusion is actually the cheapest language to use based on that criteria. Also, not to forget but there is a FREE, OPEN SOURCE version of ColdFusion used all over the web called Railo. The only difference between Railo and the Adobe version are a few tags but Railo is constantly improving the language and new tags are added all the time.
Now to be fair, I have used PHP in the past and actually wrote a few websites with it back before I learned ColdFusion and it wasn’t a terrible language. Server setup was pretty simple and changing the configuration file was also pretty easy. There are also a TON of sites written in PHP so usually if I Googled an error, somewhere, someone would have the answer but my main complaint when using PHP was the amount of code I had to write to achieve a certain function. To get a decent PHP page took long hours and tons of lines of code and really made me dislike the language more and more. Also PHP is very OOP and I was never fond of that type of programming. I would reccomend learning PHP first before any other languages though. If taught correctly, it can be a great introduction to server-side language and development but people should explore the other options.
The statelessness of server-side applications can be hard thing to grasp at first but as you begin to develop applications, you will learn real quick. Essentially, all pages that you create that use a server-side language do not contain the data until they are requested. Unlike a regular HTML page that contains all of the data, regardless of any user conditions or page variables, the dynamic page just sits there, waiting to be requested and process the code. The main issue with this is that there is no way to save the page for a particular person, without having to create for each user and with sites with hundreds of members, this would just not be practical. A way around this is using Session Variables and/or Cookies. An easy example of this is a login form. When you login to most websites, you do not have to login again until you close the browser or physically log out of the system. This is done via Session Variables. Session Variables are a sort of global varial that has ties into the browses, so they can be cleared whenever the user closes their browser. When you login somewhere, a Session Variable is created and is stored in the server’s memory to remember you. This way, you can have one dynamic page but have millions of different kinds of data show
up.
What do you think?
read more
Posted by i_am_geek on Jun 2, 2011 in Code Examples, ColdFusion, Programming | 0 comments
A client of mine came to me and asked to have the server process his product pages (cfm) to html for SEO purposes. I had done this in the past for another site but as usual, its never as simple as copy and paste. So after trying the older code, it was clear I had to make some changes.
First up, I had to make a .html product link for each product. Here is how I accomplished that:
<cfset prodlink = getproducts.name>
<cfset prodlink = replacelist(trim(prodlink)," ,-","_,_")>
<cfset prodlink = prodlink & "_" & getproducts.id & ".html">
I first set my prodLink variable to the current name of the product being displayed. I then remove any spaces in the name (for those products with long names) and insert underscores to start building the link. I then append in the id of the product (I will be using this to pull in the info later on) and then give it the .html extension.
Now lets jump over to the ISAPI part and show you what I did.
RewriteEngine On
RewriteRule ^[^?/]*_(\d+)\.html? store_info.cfm?ID=$1 [NC,L]
*For those of you unfamiliar with ISAPI, I will explain what all this means.*
First, I set the RewriteEngine to on (for security reasons, it is globally turned off) and then I started to work on the rule to grab any file with an html extension with a trailing underscore. That is what this part accomplishes “RewriteRule ^[^?/]*_(\d+)\.html?”
The second part is where I want ISAPI to redirect if the first part matches something. I need to send it to the page that displays the info, along with the ID of the product. This is how the store is functioning now. Sending an ID over a URL string to the info page, which then displays the corresponding information. So although I am now going to an html page, it is actually still hitting my ColdFusion page in the exact same way, just done as an html page instead of displaying the store_info.cfm?id= in the URL.
Now if you are reading this and saying “seems pretty simple and straight forward”. Well you are right, the solution I came up with is simple but it took me over 3 hours to get to this. I kept getting 404 errors when testing my new .html pages because it wasn’t able to redirect to the ColdFusion page. The problem wasn’t with my code, or ISAPI but the mappings on my server that ColdFusion setup on install. A blog post that I found while googling ISAPI and Coldfusion on IIS7 had my answer. The blog post (Link) stated that “The problem lies in handler mappings configuration. To resolve it, any handler mappings for *.cfm extension should be mapped to 1\jrun_iis6_wildcard.dll executable (instead of jrun_iis6.dll).”
So I looked in my Handler Mappings in IIS7 for the site I was working on and sure enough, it was pointing to the jrun_iis6.dl. A quick edit, site restart, and bam, everything worked like a charm.

The updated mapping
Now the blog post tells you to replace all of them by dropping in a config file but IIS7 has a built in way to edit these. Seeing this site doesn’t use any of the other ColdFusion extensions beyond .cfm, I only changed that one.
So thats it….3 hours of googling, testing and bugging people for help comes down to a few paragraphs and a few simple steps on how to fix my issue. Now my client has ColdFusion pages displayed with a html extension.
read more