Spam doesn't only affect your INBOX anymore. Spam is creeping into blogs,
forums posts, comment boxes, even registration services! Hi. I am the Spamerator. I am a free CAPTCHA service that
bloggers and website administrators use to tell if a real person is
submitting content to their website (like comments, registration and form
posts). CAPTCHA is most commonly the acronym for Completely Automated Public Turing test to tell
Computers and Humans Apart.
I was invented to help prevent robots from brute-force login cracking and spammers from automatically submitting garbage content to websites. I do this by sending an image with a random alpha-numerical code that only humans can see (not most robots, yet). So you can include our CAPTCHA method within your forms, anywhere you want humans-only to submit content to, or authenticate with, your website.
Although setting up your own CAPTCHA service might be easy, sometimes people find that their server resources get swallowed up from the creation of many simultaneous images. Further, sites on shared servers may not have the proper graphics libraries installed to actually create random images on the fly. As I am the Spamerator, all I do is generate CAPTCHAS. And I can do these things for you, for free.
I can be integrated within any site language including PHP, VB, ASP/.NET, Java and others. In my example below, I show you how to do it in PHP. However, if someone would like to write an example of other-language integration, contact us.
Step 1
The first thing you'll want to do is decide which forms you'd like to protect on your site. You can put them anywhere a user might submit data to your site. Then include the image reference to my handler as such:
Step 2
What goes in $SESSIONID? Good question. I have to know
who your user is when he loads my CAPTCHA image and also when he tells you what the
code I sent him. You need to send the same identifier to your user and me both times.
In PHP, it would be easiest to just create a session_start().
That way you can use the first 10 characters of your user's
session_id()
for CAPTCHA generation and subsequent validation. Your code might look something like this:
If you happen to handle
your own session generation scheme, you'll need to send us only
alpha-numeric characters, otherwise I won't work.
Step 3
Next, create an input text field next to my CAPTCHA image so that your user can tell you the number sequence I sent him. Your code might look something like this:
Step 4
Finally, you now need to check whether the code your user entered was the one I sent him in the image. You do this by collecting the user's input, send it back to me and I tell you "1" if correct and "0" for incorrect. This can be done in a few ways. The easiest way to do this is by getting the contents of a remote file by using php's file_get_contents() function. Your code might look something like this:
Example Scripts
Here are some code examples incorporating Spamerator.com CAPTCHA to use in your site.
If you would like to submit code examples in other languagnes, contact us.