CodeIgniter Forums
Just quickly - parsing HTML to secure eMail addresses? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: Just quickly - parsing HTML to secure eMail addresses? (/showthread.php?tid=4096)

Pages: 1 2


Just quickly - parsing HTML to secure eMail addresses? - El Forum - 11-06-2007

[eluser]Muppit[/eluser]
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


Just quickly - parsing HTML to secure eMail addresses? - El Forum - 11-06-2007

[eluser]CI Lee[/eluser]
As in takes entry from a form field and encodes it using something like Hivelogic's Enkoder?


Just quickly - parsing HTML to secure eMail addresses? - El Forum - 11-07-2007

[eluser]Muppit[/eluser]
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


Just quickly - parsing HTML to secure eMail addresses? - El Forum - 11-07-2007

[eluser]xwero[/eluser]
You can replace parts of the string if that is what you want
Code:
$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


Just quickly - parsing HTML to secure eMail addresses? - El Forum - 11-07-2007

[eluser]gtech[/eluser]
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!!

[url="http://uk3.php.net/preg_match_all"]PHP EXAMPLE (written/posted by aaron at parecki dot com)[/url] (serach for obfuscate)


Just quickly - parsing HTML to secure eMail addresses? - El Forum - 11-07-2007

[eluser]Derek Allard[/eluser]
safe_mailto()


Just quickly - parsing HTML to secure eMail addresses? - El Forum - 11-07-2007

[eluser]gtech[/eluser]
sorry for the misinfo Sad


Just quickly - parsing HTML to secure eMail addresses? - El Forum - 11-07-2007

[eluser]Derek Allard[/eluser]
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.


Just quickly - parsing HTML to secure eMail addresses? - El Forum - 11-07-2007

[eluser]llbbl[/eluser]
Alistpart solution requires javascript also. ><

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


Just quickly - parsing HTML to secure eMail addresses? - El Forum - 11-07-2007

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