PDA

View Full Version : Javascript, CGI, or other ways to hide Client-Side emails?


bradyj
05-19-2003, 06:10 PM
The spammers have already hit my site... again:mad:, and I've tried the below scripts, but I'm still getting hit -- does anyone have any other solutions (I've searched the topics and not seen much, or may have missed something)? I'm not necessarily looking for a Javascript, so I didn't post myself in that forum -- my IT team is very much against CGI (as they deem it highly hackable), so I'm trying to think of some other alternatives to hide our email addresses. Moderators: if this is the wrong forum, by all means move me.
For now, we can't go SSI with this site, but that will be in the future -- this is what I used for now, below --
I've tried this script:
script type="text/javascript" language="JavaScript"
var Username = "info";
var Hostname = "belairedisplays.com";
var Mailcommand = "mailto:" + Username + "@" + Hostname + "?subject=Website visitor from belairedisplays.com"

that links to this image:
img src="images/email.gif" alt="email us" class="emailus" onclick="parent.location=Mailcommand"

I've seen this, but still caused spam on other people's sites:
script language="JavaScript"
var name = "protected";
var domain = "cdrsoft.com";
document.write('<a href=\"mailto:' + name + '@' + domain + '\">');
document.write(name + '@' + domain + '</a>');

Any alternatives

oracleguy
05-19-2003, 06:46 PM
You could list your email addresses in images.

Or you could make a form that allowed people to send email and send the email using a server side script.

Also maybe if you place the javascript in an external file, to help ensure spam bots don't process it.

bradyj
05-19-2003, 07:01 PM
Why the hell I didn't think of an external javascript, I do not know. :o

oracleguy, you rock. I'm going to do that right now.

BTW, What type of Server side script would you recommend?

Nightfire
05-19-2003, 07:14 PM
I'd recommend php, it's nice and easy to learn for emails and stuff like that :)

bradyj
05-19-2003, 07:41 PM
That is what we decided just now to use to code our database backend stuff here anyways... time to learn another language, again -- will it ever end!?!:D

brothercake
05-19-2003, 08:16 PM
Bear in mind from a usability perspective - lots of people actually don't like using web forms; I'm one of them - sometimes I'd rather be told the email address and send it from my own client, so I have a record of it.

Also bear in mind from an accessibility perspective - writing the mail addy in javsacript will make it inaccessible to many users.

So I would say - use a CGI mailform, but make your email address explicitly visible as well. Beef up your SPAM filters and baton down the hatches - you do have to expose your email address if you want all your visitors to be able to contact you.

zoobie
05-19-2003, 08:53 PM
...and some webmasters deserve to be spammed. :D