If, like many webmasters, you get tons of unsolicited mail flooding your inbox, you most likely are the victim of an email extraction spider (spambot). These awful programs spread across the Internet, archiving any email addresses they find listed on websites for future spam delivery.
Almost every website has at least one contact address listed, so almost every website is vulnerable to this kind of hack-spam.
But there is a way you can prevent spammers from harvesting your email address since their spambots search the source code of your site but not the browser display. All we need to do is separate the components of an HREF Mailto Tag into separate pieces using a simple Javascript.
Consider this script:
<script language=javascript>
<!--
var showlink = "Contact Us";
var showname = "yourname";
var showhost = "yourhost.com";
document.write("<a href=" + "mail" + "to:" + showname + "@" + showhost +
">" + showlink + "</a>")
//-->
</script>
Of course, you'll need to rewrite the variables to match your own needs. What we did was disguise the "@" symbol by simply replacing it with its HTML Tag character counterpart (@). If you prefer not using JavaScript, you would probably be safe just using this:
yourname@yourhost.com
While we're on the subject of special characters, look at the source code below. Looks like a bunch of garbage, right? Now place it into an HTML page and see what happens!
WEBMASTERS
JUNCTION R
OCKS
A little prevention goes a long way towards protecting your inbox from spam!
About the author:
Muhammad Bilal is a IT engineering student. He has been working with HTML,
Graphics, and client/Server scripting languages for quite some time.
More Interesting Articles |