/    Sign up×
Community /Pin to ProfileBookmark

Email address hider

If I can find the proper command to call the ‘mailto’ function,
would the following be an easy way to hide the email contact
address from web spammers?

Or do the spammers look into the <head> section also?

[code=php]
<html>
<head>
<title>Email Hider</title>

<script type=”text/javascript”>
var EmailList = new Array();
EmailList[0] = ‘mailto://[email protected]’;
EmailList[1] = ‘mailto://[email protected]’;
EmailList[2] = ‘mailto://[email protected]’;
function ShowEmail(item) {

alert(EmailList[item]);
// some command here to do
// <a href=”mailto://[email protected]”>[email protected]</a>
// function instead of ALERT?

}
</script>

</head>
<body>
Email Spammer Hider<p />
Email me at: <a href=”#” onClick=”ShowEmail(0)”>[email protected]</a>
<br /> or: <a href=”#” onClick=”ShowEmail(1)”>[email protected]</a>
<br /> or: <a href=”#” onClick=”ShowEmail(2)”>[email protected]</a>
</body>
</html>
[/code]

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@GuerrillaJul 22.2007 — The web spammers use software which processes the whole page as a text document. It then extracts all the emails addresses from the document aswell as the links which it then follows.

The only way to hide the email from the spammer is if when you go to view souce in your browser the email address appears nowhere.

So in your example the email would be picked up in both the <a> tag and in the javascript.

The only way I can think to do it is to make the email address into a graphic and then break it up in the code like

[code=php]
var hiddenEmail = "someone" + "@" + "domain.com";
[/code]


Or something similar.

Edit: Of course if spammers are now using OCR (which is fairly easy to do with all the OCR SDK's readily available, then my idea wouldnt work, but you would cut out the amatuers.
Copy linkTweet thisAlerts:
@JMRKERauthorJul 22.2007 — So you would suggest changing to:
[code=php]
var EmailList = new Array();
EmailList[0] = 'SomeOne'+'@'+'URL.com';
EmailList[1] = 'Alternate'+'@'+'someplace.com';
EmailList[2] = 'ThirdSite'+'@+'somewhere.com';
function ShowEmail(item) {

alert('mailto://'+EmailList[item]);
// some command here to do
// <a href="mailto://[email protected]">[email protected]</a>
// function instead of ALERT?

}
[/code]

Any suggestions on the call to the email function that would replace the alert?
Copy linkTweet thisAlerts:
@GuerrillaJul 22.2007 — It will stop them reading it from the javascript but the will still pick it up from the <a> tag.

[code=html] <a href="mailto://[email protected]">[email protected]</a> [/code]

If this is left in the code then the spammer will still get hold of it. The software these guys use basically process the whole page as a text document.

You would have to change it to something like this:

[code=php]
<script type="text/javascript">
function emailFunction(n){

if (n == 1) { alert("joe" + "@" + "somedomain"); }
if (n == 2) { alert("tony" + "@" + "somedomain"); }

}
</script>
[/code]


[code=html] <a href="#" onclick="emailFunction(1)"> <img src="a_picture_of_the_email_address.jpg" /> </a> <br />

<a href="#" onclick="emailFunction(2)"> <img src="a_picture_of_another_email_address.jpg" /> </a>

[/code]
Copy linkTweet thisAlerts:
@JMRKERauthorJul 22.2007 — Thanks for the information.

As you can probably tell I'm not too familiar with his tag and it's use by spammers.
Copy linkTweet thisAlerts:
@GuerrillaJul 22.2007 — basically all you have to remember is that if you go to a page and go to view source in your browser and you can see "[email protected]" all together, anywhere in the source code then a spambot will be able to harvest it.
×

Success!

Help @JMRKER spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.29,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...