HCI Data Ltd
Hiding e-mail Addresses on Web Pages
Home Company information Request information Prices Clients Site map Contact us
 

It is never wise to put an e-mail address onto a website that has not been encoded in some way. Robots regularly scan web pages and will harvest anything that looks like an e-mail address. These harvested e-mail addresses are then passed to malicious persons so that they can send you a virus or send other people an e-mail that appears to come from your e-mail address that contains a virus. The following technique will prevent most robots from obtaining your e-mail address from a web page.

Put the following just before the </HEAD> tag in your html web page. You only need to do this once on each page than contains one or more e-mail addresses. Do not forget to change the domain name from hcidata.com to your domain name. You will need to change the domain name from 'hcidata.com' to your domain name.



<script type="text/javascript">
<!--   Hide from old browsers 

function eMailHTML(userID,visibleName) {
  var domainName = 'hcidata.com' ; //   <===== replace 'hcidata.com' with your domain name 
  var myDate = new Date();
  var protocol = unescape('%4d%41%49%4c');
  var vn = ''+visibleName;
  return (vn.link(protocol+'TO:'+userID+myDate.getFullYear()+unescape('%40')+domainName));
}

// end hide from old browsers -->
</script>

Every where you want to use an e-mail address, put the following, changing 'dummy' and 'The company Idiot' as appropriate.


<script type="text/javascript">
<!--   Hide from old browsers 

//       In the next line
//          replace 'dummy' with the part of your users e-mail address before the '@'
//          replace 'The company Idiot' with text you wish humans to see on the web page

document.write(eMailHTML('dummy','The company Idiot'));  //  <==== Change this line

// end hide from old browsers -->
</script>
If you use the above example without amendments you will see:

Cookie PolicyPrivacy Policy
Valid XHTML 1.0 Transitional
Last Updated: 25-Aug-2024
HCI Data Ltd.
HCI Data Ltd is a member of Nominet UK - the UK Internet Names Organisation HCI Data Ltd is a member of the Federation of Small Businesses