Main

PHP Archives

February 22, 2008

Great ColdFusion 8 article; how about a comparison to PHP/RoR?

Boston's own Brian Rinaldi has just authored an article on SitePoint, ColdFusion 8: Believe The Hype. In it, he tells web developers about why they should consider using ColdFusion 8, with details on increased speed, stability, AJAX integration, server monitoring, debugging, and other items. All in all, the article is a great read. Kudos to Brian for working to publicize the great strides that Adobe has made in an already-fantastic development platform.

One topic that I'd like to see more of in ColdFusion articles, though, is why a developer should switch to ColdFusion from another environment, or what the specific advantages of CF are over other languages. Until this kind of thing is addressed, I don't think that people who have already invested their time in PHP or Ruby on Rails will bother to even consider CF, not to mention bother to read CF articles. Brian quotes a ColdFusion developer at The Economist who recently upgraded to ColdFusion 8, who says, "...the whole thing is ridiculously stable." That's absolutely true, but when we have a former PHP/RoR developer saying that instead of a CF developer saying it, then we'll have reason to really shout about it!

(Sheepish) Yes, I know, I should probably just volunteer to write an article myself... but I want to encourage others to do it as well.

February 6, 2008

Creating modal dialog boxes with lightbox.js

lgw-tla.gifWhen you click on the "Member login" link on the Text Link Ads site or respond to a comment through the admin section of a Movable Type installation, you'll be presented with a new form in a slightly different manner than you're probably used to: instead of being sent to a new page, or seeing a popup window, the current page darkens, or "greys out", and a form appears immediately overlying it. It's a really neat way to keep the user in the current page context, and it neatly gets around the growing tendency for users to suppress popup windows.

They both do it with Lightbox Gone Wild, which is an adaptation of Lokesh Dhakar's Lightbox project. It's a very easy technique to pull off... link to three script files and one stylesheet in your main page; create a second page containing the code for your form; and then put a link to the second page in the main page with a class of "lbOn". Complete instructions can be found on the Lightbox Gone Wild page.

I know that cfwindow offers some of the same functionality, but it seems to me that cfwindow can't achieve the same level of flexibility as Lightbox.js can. For instance, I think cfwindow is somewhat more limited in how much of it you can style, and is also limited in whether forms in the dialog area can target the whole page.

July 17, 2007

Passing emails to ColdFusion through PHP

I've written about how you can send data to ColdFusion from another task on your server, such as passing an email from your mail system to CF through a shell script. But what if the shell script doesn't work, or what if you're on Windows and don't have access to scripting at all? Well, you can also use PHP to pass the data. Here's how.

Continue reading "Passing emails to ColdFusion through PHP" »

April 17, 2007

Writing an Email Autoresponder Script with PHP

It's very convenient for users to be able to communicate with web applications (or businesses) via email, but it's not always easy for the employees of the company to respond. Some of the email requests could be complex, and others could be simple but occur very frequently. So it's a real advantage when we can write scripts to respond to user emails for us. Here are some of the many uses I've found for autoresponder scripts:
  • Distributing emails to a dynamic, user-defined list of recipients;
  • Handling unsubscribe requests and subsequent feedback;
  • Auto-responding to support requests to let the user know their email has been received;
  • Parsing email campaign bouncebacks and marking hard bounces as bad email addresses, and;
  • Adding senders to a newsletter recipient list.

Fortunately, PHP fits nicely into the role of a scripting language which can talk to your application databases (to get user data), generate emails, and be called as a command-line interface by your mail program. That's the most important part-- many web languages support reading and sending emails and talking to your database, but few are accessible both as application servers and as command-line programs. I'll explain how to write such a script next.

Continue reading "Writing an Email Autoresponder Script with PHP" »