Using PHP and Math To slow down spammers

If you read my blog, you might have noticed a LOT of spam in the comments of the posts. I was getting 100+ a day. Getting you blog on the front page of Digg.com will do that I guess. I got tired of all the spam, so I had the server email me a copy if the comment to my T-mobile MDA phone, If I saw the post was spam, I could kill it right away. This got old because I was getting an email every 5 – 10 minutes, way more then I cared to check.

I know that captcha systems help with keeping spam robots out, but at the same time I find them hard to use so I didnt want to put one up. Also, many spam bots look for captchas and can read them now! I thought there had to an easy way to handle the problem.

Step 1
Rename the file that your form posts to. This will break many of the bots and help cut the spam for a little while.

Step 2
Using some simple php, I decided to make users answer a very simple random math problem before their post could be saved. Here is some sample code on how I set it all up.

click the thumbnail images for a larger view of the code

form.php
form.gif

process.php
process.gif

I realize that there are most likely better ways to solve this problem, like having the random numbers be displayed in images that are dynamically generated, and I will do that If this menthod fails. For right now it seems to be working. I hope that it works for you.

DOWNLOAD THE SOURCE CODE

Coldfusion MX RSS Feeds

I am a web developer by trade. I write a lot of ColdFusion code for my job, I write a lot of PHP in my spare time. Being involved in both the CF and PHP communities, I have seen an overwhelming number of tutorials for things like generating RSS feeds using PHP, but not too many geared towards CF developers.

Here is some quick and dirty code that I wrote using CF MX to generate an RSS feed using some data that I had stored in a MS SQL database.

Download the source code here

photo blog, from my phone!

I have been "blogging" I guess for about 7 years now, off and on. When I was in college, I had the worst luck when it came to girls, but I always seemed to have a date. My friends would always want to know how my date went, and I got tired of telling the same stories over and over, so I decided that I would write my stories down, post them to my website, and let my friends read for themselves… thus my "blogging" started. Over the years, when something would piss me off enough, I would write about it. I still have copies of everything I have written, its just not online anymore.

Most people with blogs use a company like blogger or live journal or something like that to host their blogs. Me being a nerd I decided to write my own.

Since I run my own server, I rarely look at 3rd party companies for hosting solutions, expecially image hosting. I know a lot of people love flickr.com, but I never really knew why… until I signed up for an account to check it out.

The first thing that grabbed my was the abbility for me to use my camera phone (T-Mobile SideKick II), to send pictures straight to the web. I was hooked. Being the computer geek that I am, I couldnt leave it at that. I had to figure out how do to this for myself.

Late last friday night, I sat down and started coding. By 4am, I was able to duplicate flickr's photo email system. The way it works is pretty simple. I take a picture with my phone. I email the picture to a special email account useing my phone. I wrote a small program that checks my email box periodically, if it finds there is an email from me, it saves the image, turns the email subject into the photos title, and turns the emails body into the photos caption. All that info gets dumped into a database. pretty simple really 🙂

So, by being able to post pictures and text to my blog while on the go, I have turned it into a "MOBLOG"…. a mobile blog. I never really used the camera on my phone before this. I love it though. I just wish that T-mobile would release a better camera on the next version of the sidekick.

To check out the images that I have taken so far, go here: http://www.notpopular.com/blog/photoList.php, or click the "photo blog" link at the top of the page

Im thinking about relasing my code as open source. Im not sure though.