Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hiding email addresses from spiders

Status
Not open for further replies.

wlfpackr

IS-IT--Management
May 3, 2003
161
US
Just wondering what some of you guys do out there to hide email addresses on your web sites from spiders and how well each method works. I've tried:

- using email addresses as images
- using @ instead of the @ sign
- JavaScript variables (which i hate b/c it is a pain)

These all seem to work, but all have huge drawbacks. Anyone else got anything good?


=================
There are 10 kinds of people in this world, those that understand binary and those that do not.
 
I use these two ASP vbScript functions to write the details on in unicode characters

strTargDomain is the site domain name in a seperate constants include file (just makes the script portable)

Code:
' convert email address to a unicode string 
function email(strName,strDisplay)
dim i
dim tld
dim Address
tld = split(strTargDomain,".")
tld(0) =  mid(tld(0),InStrRev(tld(0),"/")+ 1) 
response.write "<a href='mailto:"
response.write StrToUnicode(strName)
response.write "@"
for i = 0 to ubound(tld)
if tld(i) <> "www" then
Address = Address + StrToUnicode(tld(i))
	if i <> ubound(tld) then
		Address = Address & "."
	end if
end if
next
response.write Address	
response.write "' title='email link'>"
response.write StrToUnicode(strDisplay)
response.write "</a>" & vbNewline
end function

' convert input string to unicode
Function StrToUnicode(StrIN)
dim zz
dim tmp

tmp = ""
for zz = 1 to len(strIN)
tmp = tmp & "&#" & AscW(Mid(StrIN,zz,1)) & ";"
next
StrToUnicode = tmp
end function

Chris.

Indifference will be the downfall of mankind, but who cares?
 
Put not thy faith in Unicode. Any kind of character encoding solution is doomed - because it's quite straightforward for the spammer to write an address harvester which un-encodes them. It's already happening - see for the evidence.

To run down your options...

- using email addresses as images
Won't work if the underlying mailto: link has the email address in plain view.

- using &#64; instead of the @ sign
Won't work, full stop. See above.

- JavaScript variables
Should work if you do it right, though it won't be 100% accessible.

An option you don't mention - but probably the most effective - is to use a cgi script like formmail to send messages to you. Just be sure to give the script, and the fields that it uses, names that won't arouse the interest of automated spam senders (i.e. not "formmail.cgi" but "fred.cgi", etc.).

-- Chris Hunt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top