EllisLab text mark
Advanced Search
     
Just quickly - parsing HTML to secure eMail addresses?
Posted: 06 November 2007 08:34 PM   [ Ignore ]
Joined: 2007-10-09
15 posts

Hey fella’s, have had a hunt around for the answer to this question, I know I’ve seen it somewhere before but can’t find it now when I need it…

Simply, it’s the ability to parse a whole chunk of HTML and strip out and secure/obfuscate an eMail addresses present in that HTML block….

Can someone please tell me the name of the helper / class that does this?

Thanks!!

G

 
Posted: 07 November 2007 02:07 AM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2007-02-08
409 posts

As in takes entry from a form field and encodes it using something like Hivelogic’s Enkoder?

 Signature 

you’ve got that sexy Canadian thing working for you… - Derek Allard


Pancake Payments | http://DearIE6.com
http://twitter.com/thatleeguy

 
Posted: 07 November 2007 04:40 AM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Joined: 2007-10-09
15 posts

not sure, will look that up - I was under the impression there was a function/helper etc that would read in my page HTML from my DB table [or any source] and replace any mailto: tags with an obfuscated version…maybe I dreamt about it…not sure, but it’s intended to allow ordinary everyday people to plant email addresses all over their own sites thru the CMS I’ve built without having to think about it…if not I’m sure I can work one out, just thought I’d read it in the user manual but I’ve scoured that like a gazillion times and can’t find it.

Cheers tho

g

 
Posted: 07 November 2007 04:56 AM   [ Ignore ]   [ # 3 ]   [ Rating: 0 ]
Joined: 2006-07-14
4237 posts

You can replace parts of the string if that is what you want

$page str_replace('@',' replace with at character ',$page); 

To get the mailto working again you could reverse your replacements with javascript it they click on it

 
Posted: 07 November 2007 05:44 AM   [ Ignore ]   [ # 4 ]   [ Rating: 0 ]
Avatar
Joined: 2007-09-25
833 posts

I dont believe there is a helper for what you want, HOWEVER! hunting google there is a code example in the php documentation which looks like exactly what you need!!

PHP EXAMPLE (written/posted by aaron at parecki dot com) (serach for obfuscate)

 
Posted: 07 November 2007 09:34 AM   [ Ignore ]   [ # 5 ]   [ Rating: 0 ]
Avatar
Joined: 2006-03-23
3194 posts

safe_mailto()

 Signature 

DerekAllard.com - CodeIgniter, ExpressionEngine, and the World of Web Design

 
Posted: 07 November 2007 12:41 PM   [ Ignore ]   [ # 6 ]   [ Rating: 0 ]
Avatar
Joined: 2007-09-25
833 posts

sorry for the misinfo :(

 
Posted: 07 November 2007 01:03 PM   [ Ignore ]   [ # 7 ]   [ Rating: 0 ]
Avatar
Joined: 2006-03-23
3194 posts

Not misinfo at all!  Its great to have several different approaches.  Mine is just an alternative… and there are lots of good ways.  The problem with the CI one is that it relies on javascript to work… which I don’t like, and don’t use. 

Alistapart.com has an article now called Graceful E-Mail Obfuscation which I think is kind of overkill, but does present other options nicely.

 Signature 

DerekAllard.com - CodeIgniter, ExpressionEngine, and the World of Web Design

 
Posted: 07 November 2007 06:45 PM   [ Ignore ]   [ # 8 ]   [ Rating: 0 ]
Avatar
Joined: 2007-09-20
346 posts

Alistpart solution requires javascript also. ><

I am thinking about making a captcha function/class like google uses in groups.google.com.

 Signature 

Twitter

 
Posted: 07 November 2007 06:46 PM   [ Ignore ]   [ # 9 ]   [ Rating: 0 ]
Avatar
Joined: 2006-03-23
3194 posts

The list apart one has non-js solutions in there also, but I agree they are needlessly complex for most needs.

 Signature 

DerekAllard.com - CodeIgniter, ExpressionEngine, and the World of Web Design

 
Posted: 07 November 2007 06:54 PM   [ Ignore ]   [ # 10 ]   [ Rating: 0 ]
Avatar
Joined: 2007-09-20
346 posts

In the past, I have just made images of the email addresses. That is a good method also. smile

hmm I bet we could write a function that used GD to do this automatically ... yet another good idea I dont have time to work on.. lol

 Signature 

Twitter