You want to avoid spam?

spiros · 1 · 5875

spiros

  • Administrator
  • Hero Member
  • *****
    • Posts: 854551
    • Gender:Male
  • point d’amour
If you have a web page and you add a link in the form of

Code: [Select]
<a href="mailto:myname@mydomain.com">myname@mydomain.com</a>
then you are easy prey to spambots (automated applications which harvest emails from the web)

Here is a trick to "cloak" your e-mail address and make it invisible to spambots. You need to paste this code in your web page, at the point where you want your e-mail to appear. Before you use it remember to change:

1) myname - with the bit which is on the left of your e-mail
2) mydomain - with the bit which is on the right of your e-mail up to the dot
3) com - with the bit which is on the right of your e-mail up after the dot


Code: [Select]
<SCRIPT LANGUAGE="JavaScript">
<!-- // Javascript Email Address Encoder
//  by www.stevedawson.com

var first = 'ma';
var second = 'il';
var third = 'to:';
var address = 'myname';
var domain = 'mydomain';
var ext = 'com';
document.write('<a href="');
document.write(first+second+third);
document.write(address);
document.write('@');
document.write(domain);
document.write('.');
document.write(ext); 
document.write('">');
document.write('Click here to e-mail me!</a>');
// →
                           
</script>
« Last Edit: 22 Nov, 2004, 19:53:28 by spiros »


 

Search Tools