5 Web Design Tips You Can't Live Without - Combating Internet Spam Spiders (Page 2 of 7 ) Often, a bony, lanky black spider will crawl around your web site, wiggle its little feet in excitement, gather up your e-mail address and store it near its pinchers. Then, when it returns to its master, it will religiously add all gathered data to a huge nest of e-mail addresses, then used as bait to sell to marketing firms. Those little black spiders are software utilities that slither underneath your page's surface, at underlying HTML code, specifically for a standard formatted e-mail address (name@domain.com). This can be the most effective method for gathering e-mail addresses and needs to be thwarted. There are a number of techniques web designers can implement to protect against these creepy crawly little annoyances. Of the many, here are three that can work quite well: - Use HTML symbols. To disable spiders from grabbing your e-mail address, some formatting modifications need to be made to fool the software. All e-mail addresses use the at symbol (@), and spiders are taught to look for them. HTML symbols are written directly into the HTML code, but are interpreted by the browser into their actual meaning. The HTML symbol for the @ sign is @. So, how do we implement something like this?
<a href="mailto:name@domain.com">
All we do is replace the @ sign with the HTML symbol that represents it. We have a utility built that will automatically convert your entire email address to HTML symbols, here. This method, however, is sometimes caught by more sophisticated software. Although most are not quite as advanced, they do exist. How do we surpass this hurdle? Let's try some Javascript.
- Using Javascript, we will simply break up the e-mail address into four different sections, 1: name, 2: the @ sign, 3: domain, 4: extension. Here is a simple implementation of Javascript to perform this action.
<script type="text/javascript"> name ="you" domain ="domain" extension =".net" document.write('<a href="mailto:' + name + '@' + domain + extension +' " ' +' >e-mail link here '); </script>
The above code is fairly self-explanatory. We define three variables, name, domain and extension, and simply concatenate those variables within a document.write statement to the browser. Notice we use HTML's anchor tags within the write statement so your browser will interpret the e-mail link correctly. There is another problem with using this method...can you figure it out? Javascript is client-side, which means although spiders might not be able to interpret your e-mail address, browsers with Javascript capabilities turned off will not either, meaning your e-mail address will not be displayed to the user.
How do we fix this problem? Can we get away with refusing to display any e-mail address? Yes, we can, but we still must provide a way for the user to contact us. The solution is a rather simple email form.
- The third might be the only full proof method of protecting yourself against spam spiders, and that is simply refusing to display your e-mail address. Instead, if your server supports server-side processing, like Perl, ASP, Cold Fusion or PHP, simply design a feedback form, and call a server-side script to process the data behind the scenes. Sorry boys, spiders can't dig quite that deep.
I am a huge advocate of PHP, but choose whatever language that your host supports. Please note that if your server does not support any server-side programming language, you are out of luck in this regard. Chose between the two aforementioned methods, and stick with it.
Next: Take the Typography Test >>
More Development Cycles Articles More By Steve Adcock |