Easiest way to protect e-mail address in content from spam

dresde - April 7, 2009 - 11:51

Hi there,

I'm setting up a "staff" page in a Drupal site that has the e-mail of the people. The old site (built in XHTML and CSS) uses a simple JavaScript to protect this e-mails from spam, just writting

               <script language="JavaScript" type="text/javascript">
   <!--
var string1 = "name";
var string2 = "@";
var string3 = "mydomain.com";
var string4 = string1 + string2 + string3;
var string5 = " class=normal";
document.write("<a href=" + "mail" + "to:" + string1 +
string2 + string3 + string5 + ">" + string4 + "</a>");
//-->
                  </script>

And this simple line in

<script language="JavaScript" type="text/javascript">

So I'm looking for the easiest way to write those e-mail address in Drupal preventing the spam. I have seen that it's possible to use this same system but you need to create a .js file and upload it somewhere, but I don't know where to upload it and what does that file need to content.

Can anyone explain that?
Is there an easiest way to do this in Drupal?

Thank you.

Have a look at

marquardt - April 7, 2009 - 13:12

Have a look at http://drupal.org/node/121997 (or go Documentation -> developing for Drupal -> JavaScript in Drupal).

You can also specify additional JavaScript file in the Theme's .info file (see http://drupal.org/node/171205#scripts), but the disadvantage is that your script will be loaded on every page.

Thanks for the reply, but I

dresde - April 7, 2009 - 13:29

Thanks for the reply, but I need something more "for dummies", that was too heavy for me :(

i recently discovered the

arh1 - April 7, 2009 - 15:45

i recently discovered the spamspan module. can't vouch for it's effectiveness yet (ever?), but check it out and see what you think.

 
 

Drupal is a registered trademark of Dries Buytaert.