Archive for the ‘Web Applications’ Category

Using Doctrine 1.1 with Symfony 1.2

May 4th, 2009

I recently started a new project using the Symfony PHP Framework. I’ve used Symfony before and love it. In the past I’ve used Propel, but as Symfony now fully supports Doctrine and Doctrine looks very promising, I decided to give it a shot for my latest project.

Symfony 1.2 currently uses Doctrine 1.0. Doctrine 1.1 was released in March. Symfony 1.3 will support Doctrine 1.1, but won’t be released until November.

Since I’m starting a new project, I wanted to try to use the latest version of Doctrine. I’ll be honest, I don’t have a great reason for doing this other then the pain I went through migrating an old project (with lots of custom model stuff) from Propel 1.2 to Propel 1.3. I understand this is an apples to oranges comparison, however its the only motivation I’ve got. Feel free to stop reading now.

Web Applications ,

Reloading reCAPTCHA with error via Javascript

February 20th, 2009

Today I needed to add a captcha to a web form used to send emails. Ordinarily this is pretty simple using the reCAPTCHA service. There was only one problem: the form was validated and submitted via AJAX rather than a regular HTTP post.

The reCAPTCHA client API provides a reload javascript method that will grab a new set of words for the user to decode. It was easy enough to display a small error message above the reCAPTCHA div and call this method when the user responds incorrectly.

In a typical setup, as described in the reCAPTCHA client API, the standard theme can display an error message when the user responds incorrectly. This is done by appending an error URL parameter to the challenge. The error message I was adding via javascript was showing up above the reCAPTCHA module rather than just above the text box. I wanted to display the error message included in the standard reCAPTCHA theme.

Web Applications , ,