Forum Moderators: mack
I am trying to hide my email address from spammers.
The code is basically as follows:
<form name="feedback" method="post" action="http://www.whatever.com/cgi-bin/userform.cgi">
<input type=hidden name="SendMailTo" value="whoever@whatever.com">
I tried using hex values for my email address instead of text but this did not work.
I am using another method for my main pages, which is as follows. It splits up the email address using Javascript and uses an image to display the address. I am wondering whether I can adapt the javascript method to the form above. I gather that PHP can be used for this sort of thing but I dont know any PHP at all and not even sure if my web host recognises it. Below is what I currently use (I hope it is of some use to anyone who reads this post):
<script language="JavaScript">
userpart1 = "who";
userpart2 = "ever";
sitepart1 = "what";
sitepart2 = "ever.com";
document.write('<a h' + 'ref="m' + 'ailt' + 'o:' + userpart1 + userpart2 + '@' + sitepart1 + sitepart2 + '\">');
document.write('<img src="email-image.jpg" border="0" height="35" width="115" alt="email address as image">' + '</a>');
</script>
Thanks
Alasdair
sorry cannot quite follow.
I wish to have an enquiry form as well as an email address on my site.
I cannot access the cgi code - my web host doesnt allow me to get in there and tamper with it, nor could I anyway as I dont know any perl.
The line of code you suggest - where do I place it?
Thanks
The disadvantage is that people who surf with Javascript turned off will not see the form either. So its possibly not ideal.
Such as: <a href="mailto:sup">sup</a>
I removed the bulk of my email address just for example's sake. The utility is called Mailto Encryptor and is only like 10kb. Maybe this is what you're looking for?
Hex values and URL encoding are already being decoded by spammers.
The javascript document.write stuff is still good (however I would use an external file for the code), but don't forget to escape the closing </a> tag by using <\/a> if you want valid HTML code.
Interesting to read that the hex/ascii method has been found out.
The reason why it did not work for me is that I use an HTML hand-coding tool, rather than plain old notepad for my page creation, and it automatically converts asci code into ascii text! I have noticed that wysiwyg web page editors do so as well.
All very well if you never use anything other than notepad, but inconvenient otherwise.
I wonder how long it will take before the spam spiders can read javascript?
<form id="feedback" onsubmit="InsertEmail();return true" method="post" action="http://www.whatever.com/cgi-bin/userform.cgi">
<input type="hidden" id="SendMailTo" value="later">
and in the <head> section you have defined your script:
<script type="text/javascript">
function InsertEmail() {
document.getElementById("SendMailTo").value = <what-ever-email>;
}
</script>
If you need to use more than one email-address on the same page you can pass a parameter in the call to InsertEmail and use a case structure to select the right one.