I’ve used Wordpress in the past for blogs that I write in. One thing that bothers me the most is the inadequate spam filtering they have. The blogs never really got any more than a few visitors a day, but the spam piled up and I was getting about 10 - 20 a day. Each one triggering an email notification that they’ve arrived. It’s such a let down to think you got a new comment for an article.

Anyway, I was forced to look into Wordpress’s plug-in library for spam filters finally choosing Akismet for all of the good reviews it got. Akismet worked okay, but there was still spam coming through. I wanted a solution that was transparent to the user, required no work on my part, and worked 100% of the time.

Unfortunately nothing I found existed for Wordpress and I wasn’t about to rewrite the commenting system. So I stumbled upon a neat little trick when looking through Ryan Grove’s Pants Blog Engine code (currently not being developed anymore). The code looks like this (you’d throw it into your comment form):

<input style="display:none;" type="text" name="content" value="" />

It’s simply a hidden input with the normal looking ‘content’ name to it. The trick here is that most, if not all spam bots will insert data into every form field that they can before submitting it. Since this one’s name is ‘content’ the spam-bot will assume that its the main content field and throw in its spam message. Once the comment is submitted, the server side logic then simply checks to see if any data exists in the $_POST[‘content’] variable. If so, you know that a human didn’t enter it, and you can process the bad request accordingly.

Now if you’re concerned that the bot could parse the display:none; and leave the info out, include it in an external stylesheet or have javascript hide that input. Even still, throw it in a <input type="text" /> tag that has display:none; set.

I’ve used this technique on this site as well as a few others I’ve done and have not once gotten a single spam message. It’s worth the effort to put it in.

Divider

Having spent a few weeks dealing with a few personal issues, I’ve rediscovered what it’s like to be back in the saddle writing code again. I can’t explain to you how good it feels. I went through a little spell contemplating whether or not designing web sites and writing stupid little web apps was something I wanted to do with my life.

Generally I feel that people need to take a break from the routines in their lives. I’ve come an understanding recently that maybe you need to take a step away from the daily grind, let a few things go for a while, so that you can come back to appreciate them even more. I’m not just talking about programming, I think this applies to everything you do in life: your job, your close friends and family, your hobbies.

It’s interesting, I never would have thought this way until I get a well deserved kick in my arse. But maybe thats just life… learning through mistakes.

Divider

A Brand Spankin New Site

0 Comments Filed under Updates

I can’t explain how long designing this site has taken me. There have been 3 total iterations each one resulting in a complete make-over and a lot of yelling. I don’t know what it is about making a site for yourself but there were a few weeks where I almost lost it. Anyway, I’ve taken a few screen shots of the design for this site as it’s progressed over the past couple months.

Layout 1: An Old Book

Layout 2: 3D Boxes

Layout 3: Snowscape

There you have it. I remember tossing and turning around in bed towards the end of the first layout. I was trying to write both a site and a blog engine at the same time and it wasn’t working out. It was prior to the third layout when I discovered the amazing CodeIgniter PHP Framework. It’s the probably the most straightforward, easy-to-use framework I’ve ever come across. I looked into Cake and one other but CI is perfect. I’ll write up a review later about it.

Anyway, stay tuned as I put up the rest of the pages of the site.

Ahh, my 9th symphony. I've arranged this piece for xHTML, CSS, PHP and MySQL. It should sound beautifully across all instruments, and was meticulously prepared with standards and accessibility in mind. View the Colophon, or contact me. All material © 2008 Mike Gioia, et al.