How to stop spammers from receiving email addresses from mailto links?

Duplicate:


What is the best way to prevent spammers from getting an email address from your email links? I have the impression that javascript might be the solution. I do not know if my current decision is proof of a fool, so I ask.

Here is what I am doing now:

<script language="JavaScript"><!-- var name = "emailusername"; var domain = "yahoo.com"; var text = " emailusername@yahoo.com "; document.write('<a href=\"mailto:' + name + '@' + domain + '\">'); document.write(text + '</a>'); // --></script> 

Is there a better way? I don't like having this piece of code wherever I want to put the mailto link.

+4
source share
7 answers

Javascript helps, but that doesn't help. The email address is still displayed in the html source using this type of script.

The "best" options use client-side javascript to "assemble" the email address from parts, so the entire email address is never displayed in the HTML source in a single fragment. The browser unites you on the client.

+2
source

This is not even a remotely good way. Spammers will capture all this and match the addresses with the regular expression. They will not worry about finding mailto :. In addition, any scheme that you can come up with using Javascript has already been eliminated by a spammer. In fact, they will probably just be able to run javascript and get the address.

You can

A) Filter spam
B) Use the form to send mail (which spammers are likely to use).

0
source

You are on the right track, but having an emailusername for your own defeat (most spider bots did not bother to distinguish between HTML code and script and just look for everything that appears on the page).

I heard that some spider bots have the ability to run Javascript now and will allow this obfuscation themselves.

0
source

Simple fix:

 <script language="JavaScript"><!-- var name = "emailusername"; var domain = "yahoo.com"; document.write('<a href=\"mailto:' + name + '@' + domain + '\">'); document.write(name + '@' + domain + '</a>'); // --></script> 

Which is basically the same as Reed, but with you the existing code.

0
source

There is no 110% sure way to prevent this, except for silent tricks that simply interfere with the use of email, for example, putting all email addresses as images, etc.

At least, I personally admitted that the addresses will be collected at least to some extent. I use this little php function to html-encode all email addresses. Thus, they will be absolutely suitable for use by all real browsers, but to fool the most stupid harvesters. As I said, this is not 110%, but I am satisfied with it.

 function turboencode($s){ $tempstr = ""; for($i = 0; $i < strlen($s); $i++){ $c = substr($s, $i, 1); $tempstr .= "&#" . ord($c) . ";"; } return $tempstr; } 
0
source

The best way to prevent harvesting is to simply not have a mailto: link at all.

In addition, there are not many counters. Things like CSS content and images have been tried and worked around, and JavaScript is an incomplete non-solution (which means it doesn't work).

One possible counter is obfuscation: add nonsense to your address:

 mailNO`at`SPAMyahoo`dot`com 

And most automatic combines (initially) have some problems finding it. Alternatively, things like comments can be used to confuse most harvesters. (RFC822 describes the full syntax of email addresses, which includes comments as part of the address specification.)

Another counter is to use some form of CAPTCHA form.

None of them are fully effective.

0
source

All Articles