Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

denisl

macrumors newbie
Original poster
Sep 18, 2009
2
0
I get a lot of spam recently and I think is from my contact page... how do I encode my email address so that It won't be picked up by spam bots?:confused:
 
Create a form that sends your visitor message through a php file. You can find lots of tutorials for this on the net.

The next step will be then to add a "capcha" (encoded image) to protect yourself from robots.
 
I "protect" the contact page using a captcha. I got the code from here. Basically there is the one page with the following logic:
PHP:
if $_POST is empty, ie first time on page, then
   create and show captcha with entry form underneath
else
   check contents of $_POST array
   if valid code entered then
      show contact form
   else
      refresh the page which generates a new captcha
   end if
endif
 
The next step will be then to add a "capcha" (encoded image) to protect yourself from robots.
CAPTCHAs are generally un-user friendly and often have accessibility issues.

Can't you just have your email address as an image instead of a text link?
That's an accessibility issue as blind visitors won't be able to access the email address.

My way is to use a PHP powered contact form. There's various techniques to combat spam using PHP. I've even given briefings on it (not currently publicly viewable). Here's a place to start reading about security for contact forms. There's a number of already built contact forms that you can install relatively easily. Just make sure they offer appropriate security and are accessible.
 
Depends how secure you want this to be;

The best way would be to use the excellent reCaptcha tool (Its easy to add and it will do the best job).

http://recaptcha.net/

You could also use Javascript to write the address to the page, most Trawlers dont have Javascript enabled, so this would prevent the email address being read by them (Not foolproof)

You can put your email as an image, as special characters, or spaced, but they are less effective at stopping spamming and make it more annoying to your users.

---

Create an email alias with a higher spam filtering setting and use that as your public alias, thats what I do.


Hope that helps, but I would go with the first route, it also helps out a worthy project.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.