473,386 Members | 1,803 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Protecting e-mail address in XHTML

I have XHTML pages that I deliver as application/xhtml+xml
I used to have a Javascript that hid an e-mail address from spam bots, but
displayed properly the e-mail address on web browsers.
How would you show an e-mail address in the browser but protecting it from
spam bots?
What works for text/html doesn't for application/xhtml+xml, such as
document.write...
Do you have a solution?
Thanks,

--

Kerberos.

http://www.opera.com
http://www.freebsd.org
http://www.auriance.com
http://www.osresources.com
http://exodus.jabberstudio.org
Jul 20 '05 #1
8 1862
On Wed, 22 Dec 2004 19:34:33 -0200, Kerberos <me@privacy.net> wrote:
I have XHTML pages that I deliver as application/xhtml+xml
Well stop it ! (read Appendix C or c.i.w.a.h )
I used to have a Javascript that hid an e-mail address from spam bots, but
displayed properly the e-mail address on web browsers.


So your problem is nothing to do with email addresses at all, and is
really to do with how to embed JavaScript inside XHTML, without it
being non-well-formed XML.

Either hold the JavaScript in an external document, or use a CDATA
section.
--
Smert' spamionam
Jul 20 '05 #2
Em Thu, 23 Dec 2004 01:36:33 +0000, Andy Dingley <di*****@codesmiths.com>
escreveu:
Either hold the JavaScript in an external document, or use a CDATA
section.


I created a page with an embedded JS protected by CDATA. The page is sent
with MIME type application/xhtml+xml:
http://www.auriance.com/clientes/cpe/essai2.php
It works fine with Opera, IE (sent as text/html in this case), but with
Firefox it won't show the email address.

--

Kerberos.

http://www.opera.com
http://www.freebsd.org
http://www.auriance.com
http://www.osresources.com
http://exodus.jabberstudio.org
Jul 20 '05 #3


Kerberos wrote:

I created a page with an embedded JS protected by CDATA. The page is
sent with MIME type application/xhtml+xml:
http://www.auriance.com/clientes/cpe/essai2.php
It works fine with Opera, IE (sent as text/html in this case), but with
Firefox it won't show the email address.


With Mozilla/Firefox and Opera you can't use document.write in
application/xhtml+xml.
With Mozilla/Firefox you can't use innerHTML either with that content type.
Here is an example to solve the task using DOM scripting:
<http://home.arcor.de/martin.honnen/javascript/200412/test2004122302.xhtml>

I am not sure however that approach to the email harvesting protection
is a viable one but perhaps you can use the script code.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 20 '05 #4
On Thu, 23 Dec 2004 09:49:21 -0200, Kerberos <me@privacy.net> wrote:
http://www.auriance.com/clientes/cpe/essai2.php


Why not post this to c.i.w.a.h instead ? The script author is a
regular poster there.

Jul 20 '05 #5
On Thu, 23 Dec 2004 09:49:21 -0200, Kerberos <me@privacy.net> wrote:
I created a page with an embedded JS protected by CDATA.


Your script is built out of dodgy IE-specific JScript.

e.innerHTML = "<a href=\"mailto:" + address + "\">" + address +
"</a>";
I haven;'t looked closely, but I think Opera supports this, Mozilla /
Firefox don't (sadly). You can achieve similar results in a compliant
manner, but with a _lot_ more code -- you'd need to create a <link>
element as a JavaScript object with document.createElement() and then
insert it into the HTML document with HTMLDomElement.appendChild()

--
Smert' spamionam
Jul 20 '05 #6
Em Thu, 23 Dec 2004 14:09:00 +0100, Martin Honnen <ma*******@yahoo.de>
escreveu:
Here is an example to solve the task using DOM scripting:
<http://home.arcor.de/martin.honnen/javascript/200412/test2004122302.xhtml>


At last! Thanks, it's working on "major" browsers, including Opera that I
use as default browser.
Take care,

--

Kerberos.

http://www.opera.com
http://www.freebsd.org
http://www.auriance.com
http://www.osresources.com
http://exodus.jabberstudio.org
Jul 20 '05 #7
>>>>> "Kerberos" == Kerberos <me@privacy.net> writes:

Kerberos> How would you show an e-mail address in the browser but protecting it
Kerberos> from spam bots?

Please <a href="mailto:merlyn@stonehenge.com">send
mail to me at <tt>merlyn@stonehenge.com</tt></a> and I'll reply.

That's sufficient for today's bots. Unlikely need to change, because
there's SOO many low hanging fruit there. No Javascript required. Nothing
fancy. Just replace the @ with @ and you're done.

Spammers do *not* de-entitize. This has been observed repeatedly. There's
no point in working harder than you must.

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<me****@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
Jul 20 '05 #8
Randal L. Schwartz <me****@stonehenge.com> wrote:
Spammers do *not* de-entitize. This has been observed repeatedly.


If you have a report or similar saying that, I would be interested in
reading it (sounds like I don't believe you, I know, but that's not the
case :-)

--
David Håsäther
Jul 20 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

24
by: Yang Li Ke | last post by:
Hi guys! Anyone know a way so that users purchasing my scripts would not be able to share them with other people ? Yang
18
by: Alan Sheehan | last post by:
Hi pythonistas, I am looking for methods of deploying applications with end users so that the python code is tamper proof. What are my options ? I understand I can supply .pyc or .pyo files...
6
by: nell | last post by:
Hi all, I've developed a testing application in python, and should supply it in a way that no one (lets say they are regular users) will understand it and edit it. The application source is all...
12
by: Roland Hall | last post by:
I read Aaron's article: http://www.aspfaq.com/show.asp?id=2276 re: protecting images from linked to by other sites. There is a link at the bottom of that page that references an interesting...
1
by: M.C. Radhakrishnan | last post by:
Hi, I need to provide a facility to do routine database administration (backups, etc.) without allowing the logged in user to modify the data in any of the SQL server tables. Is there any way...
4
by: Jonathan Henderson | last post by:
Obfuscators aren't only used for protecting intellectual property. See the hacker demo at this link: http://www.preemptive.com/documentation/NetHackerDemo.html For those who don't know what...
5
by: John | last post by:
Dear all, I've got a security question that is so difficult that "maybe" there will be no answer for it. It's regarding protecting asp code. I did write some asp code, that I sell to...
12
by: Dr. Edmund M. Hayes | last post by:
I wrote a access program that works well enough that a handful of people would like to buy it from me. My problem is that if I sell it to someone there is no mechanism that I know of to protect...
22
by: flit | last post by:
Hello All, I have a hard question, every time I look for this answer its get out from the technical domain and goes on in the moral/social domain. First, I live in third world with bad gov., bad...
0
by: xamman | last post by:
hi there! according to msdn (link at bottom) i should be able to protect a whole class declaratively as above. However i keep getting 'request for principal permissions failed' exceptions. in...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.