Image Verification and Comment Spam

This blog and a few others that people I know use are run off php scripts that I wrote. Instead of an all-singing all-dancing set of scritps I´ve generally just added bits to it when it´s been needed.

 
The latest problem we´ve had is comment spam. I haven´t bothered to track down who it was but the content was always MIME code (the stuff emails are made up of) which doesn´t really make sense since most comment spam is used to boost a sites serps. I have finally got around to sorting it out though.
 
Now all the post´s comment forms have one of those images where you have to enter the string of characters into the box to enter a comment. It´s all done by through php which randomly generates a string of characters, creates an image with the string in it, outputs the image to the browser and then destroys it. It also stores the string in a session variable and then when someone submits a comment it checks that what they´ve entered to see if it matches what is stored in the session. If not it outputs an error message. Job done.
 
Now lets see how long it is until some bored script kiddie reads this and tries to hack it!

About the Author

I'm a web developer based in the East Midlands, UK and if I keep up the current rate, I might have developed 3 million sites by the time I retire