Hosting with an edge
Reply to topic
Dramatically cut down on SPAM or avoid it altogether
Nahoo
Site Admin

Joined: 24 Jul 2002
Posts: 91
Location: Brighton, England
Reply with quote
If you want to stop SPAM spiders (robots that search for emails on the web), disguise your email address or avoid placing it on your website altogether.

As you may want visitors to email you (with or without a form), please use the following code rather than a normal email link. In your browser, this looks identical anyway...
Code:
<script language="javascript">
<!--
{
var alias="info";
var domain="yourdomain.com";
var subject="Email Subject";
document.write("<a href=\"mailto:" + alias + "\@" + domain + "?subject=" + subject + "\">");
document.write(alias + "\@" + domain + "</a>");
}
-->
</script>

Would look like: [url=mailto:info@yourdomain.com]info@yourdomain.com[/url] with a prewritten email subject: "Email Subject".

Alternatively...
Code:
<script language="javascript">
<!--
{
var alias="info";
var domain="yourdomain.com";
var subject="Site Message";
var text="email me now";
document.write("<a href=\"mailto:" + alias + "\@" + domain + "?subject=" + subject + "\">" + text + "</a>");
}
-->
</script>

Would display as: [url=mailto:info@yourdomain.com]email me now[/url] with a prewritten email subject: "Site Message".

With the subject variable, it may be advisable to use %20 instead of actual spaces as all URLs shouldn't really contain spaces.
Code:
var subject="Site%20Message";


If you want to hide the recipient email address form to mail scripts, check out the Perl section or read the help file at the bottom of the new MailForm.cgi, provided at: www.designextreme.net/support/scripts

Step by step approach
1. Open up your HTML editing program (eg. Dreamweaver)
2. Select the email address you want to replace (you can use Find in many programs)
3. Copy code above over your existing email address or email address link
4. Edit the 3 var lines (e.g. "xxx" shown in: alias="xxx"; )
5. Edit the email me now bit to show your own message.
6. Save, upload and view!


Last edited by Nahoo on Mon Sep 16, 2002 10:13 pm; edited 1 time in total

_________________
Forum Administrator
http://dahost.net
View user's profileSend private messageVisit poster's websiteICQ Number
Nahoo
Site Admin

Joined: 24 Jul 2002
Posts: 91
Location: Brighton, England
Reply with quote

_________________
Forum Administrator
http://dahost.net
View user's profileSend private messageVisit poster's websiteICQ Number
Dramatically cut down on SPAM or avoid it altogether
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic  
&copy;