« January 2009 | Main | March 2009 »

February 2009 Archives

February 20, 2009

Watch out for Apache handling of files with multiple extensions

A note for future reference: saving CFML or PHP sample scripts with a .txt extension after the .cfm or .php extension so that they can be displayed as text in the browser doesn't work on Apache servers. Apache doesn't just look at the last extension in the filename, it looks at all of them that have handlers specified, the next matching extension overriding the previous. So if there isn't a .txt handler, a file named like sample.code.php.txt will be parsed by the PHP engine.

There is a way around this issue; you can use the SetHandler directive instead of the AddHandler directive:

<FilesMatch \.cgi$>
   SetHandler cgi-script  
</FilesMatch>

February 12, 2009

Don't forget to download a Railo license

Either I wasn't paying enough attention to the Railo website, or they don't explain well enough how licensing for the Community Edition works. Probably both. But I got a suprise on my Railo-based website yesterday...

Continue reading "Don't forget to download a Railo license" »

February 9, 2009

Using svn+ssh over a non-standard port

Just a tip for those of you who, like me, have svn+ssh access to a Subversion server whose ssh port is not set to the usual value of 22: you can usually specify the port right after the server name, like so:

svn+ssh://svn.someserver.com:12345/path/to/repo

svn+ssh is a protocol that provides more security than using just svn over port 3690 or port 80, since all of your traffic will be encrypted like any other ssh communications.

Creating a customized URL to automatically log people in to a Connect session

Our marketing department has often wished that they could make two improvements to our Connect webinar process: first, that we could somehow get an automatic list of who attends the Connect session; and second, that our users didn't have to log in to the Connect session in the first place. Right now, you have to enter your name in the login form before you are allowed into the webinar.

So I did a little looking around in the Connect login form, and I found that the URL that the user is redirected to after using the form is in the format http://yoursubdomain.acrobat.com/[webinar name]?guestname=[user's name]. Now that we know what Connect is expecting, we can instead link to ColdFusion code which tracks the webinar attendance in a database, then redirect the user to the Connect webinar that we generate ourselves.

So, now that's the exact kind of link that we embed in our webinar invitation emails. For instance, if the Acme company had a webinar named '2009-Products' and it was sending an invitation to Jane Prospect, it would embed the URL http://www.acme.com/webinar.cfm?webinar=2009-Products&guestname=Jane%20Prospect, record her as an attendee in our database, then redirects the user to the webinar at http://acme.acrobat.com/2009-Products?guestname=Jane%20Prospect. Both goals accomplished.

February 6, 2009

Form fields created with JavaScript not posted to Firefox?

For the longest while, I've known that it's possible to create form fields on the fly with JavaScript, say, for the purpose of offering as many file upload fields as a user needs in a form. I could always get the script to work, either with the appendChild() function or by writing to innerHTML. And though posting the dynamic form would work in IE, I could never get the form fields to POST to Firefox. Happily, I've just found out why it didn't work for me while other developers never seemed to mention the problem in their blogs.

It's my coding habits.

The more detailed reason is that because of a quirk of browser style history where form tags caused extra vertical "padding" in a web page, I've always embedded my form tags within table tags:


<table>
<form>
<!-- Table rows and cells -->
</form>
</table>

And the answer to the problem is to take my form tags out from inside the table. Voila! Any dynamic fields created in the form will now be posted correctly in any browser, including Firefox.


<form>
<table>
<!-- Table rows and cells -->
</table>
</form>

So I thought I'd share this in case anyone else shared this same habit. As for the extra whitespace, I'm advised you can just apply CSS to your form tag to get rid of the padding.

February 5, 2009

Boston CFUG meeting: Adam Lehman, Adobe evangelist, talks ColdFusion 9 and Bolt

I'm announcing our next meeting on short notice, but for a very good reason: we've scheduled Adam Lehman as well as the lead engineers for ColdFusion and Bolt for next Wednesday, Feb. 11th, 6:00-8:00pm at Adobe's offices. This is a meeting you will definitely want to attend.

Adam, Adobe's ColdFusion evangelist, will present some of the upcoming changes in ColdFusion 9 (aka Centaur) and Bolt, the new ColdFusion IDE. Ram Kulkarni, who is the lead engineer on Bolt, and Hemant Khandelwal, who is Director of Engineering for ColdFusion, will also be there. They will open this up for a question-and-answer period as well, so this is a great opportunity for you to learn what changes are coming in ColdFusion's future.

Make sure to become a member on the CFUG's new site at: http://groups.adobe.com/groups/14433c4223/summary

And, make sure to register for this particular event with our EventBrite system at: http://www.eventbrite.com/event/275123903


If you're in the Boston area, I hope to see you there!

February 3, 2009

Data security: encrypting data in the database

For extra security, you may want to encrypt important information in your database so that someone who hacks in can't read it easily. For instance, you could be saving credit card information so that you can bill for services, or you could be saving the customer's sensitive business information. Here's the method I use to encrypt and decrypt important information.

Continue reading "Data security: encrypting data in the database" »