By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,403 Members | 1,690 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,403 IT Pros & Developers. It's quick & easy.

ereg_replace safe e-mailadress

P: n/a
Hi all,

I use:
$text=ereg_replace ('[_a-zA-Z0-9\-]+(\.[_a-zA-Z0-9\-]+)*\@' .
'[_a-zA-Z0-9\-]+(\.[a-zA-Z]{1,3})', '<a
href="mailto:\\0">\\0</a>',$text);

to replace all e-mailadresses within a block of text to clickable
links. I wonder if anyone knows how to convert these clickable links
into protected adresses (I know you can't protect an e-mailadress for
100%, but encoding it a bit can help for a huge part off all the
harvest spam).

Thanx

Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On 2005-05-04, Evelyne <ev************@gmail.com> wrote:
Hi all,

I use:
$text=ereg_replace ('[_a-zA-Z0-9\-]+(\.[_a-zA-Z0-9\-]+)*\@' .
'[_a-zA-Z0-9\-]+(\.[a-zA-Z]{1,3})', '<a
href="mailto:\\0">\\0</a>',$text);
So far for people with a domaain name that ends with .info
to replace all e-mailadresses within a block of text to clickable
links. I wonder if anyone knows how to convert these clickable links
into protected adresses (I know you can't protect an e-mailadress for
100%, but encoding it a bit can help for a huge part off all the
harvest spam).


Simply stop displaying e-mail addresses at your site. Map all your
e-mail addresses to an integer, and then display the integer. If the
visitor then sends an e-mail, lookup the address associated witht that
number. This way you can also perform "float-control".

--
Met vriendelijke groeten,
Tim Van Wassenhove <http://www.timvw.info>
Jul 17 '05 #2

P: n/a
Evelyne wrote:
I use:
[some regex that bears no relationship to the actual syntax of e-mail
addresses in theory or in practice]
to replace all e-mailadresses within a block of text to clickable
links. I wonder if anyone knows how to convert these clickable links
into protected adresses (I know you can't protect an e-mailadress for
100%, but encoding it a bit can help for a huge part off all the
harvest spam).


Wouldn't any encoding or whatnot of the address that is effective
against harvesters be detrimental to real people? Just look at the
Google Groups interface for a case in point.

--
Jock

Jul 17 '05 #3

P: n/a
Tim Van Wassenhove wrote:
On 2005-05-04, Evelyne <ev************@gmail.com> wrote:
Hi all,

I use:
$text=ereg_replace ('[_a-zA-Z0-9\-]+(\.[_a-zA-Z0-9\-]+)*\@' .
'[_a-zA-Z0-9\-]+(\.[a-zA-Z]{1,3})', '<a
href="mailto:\\0">\\0</a>',$text);
So far for people with a domaain name that ends with .info

The e-mailadresses that are going through this code aren't .info
addresses. In fact, they're all from three specific domains. No *.info.

to replace all e-mailadresses within a block of text to clickable
links. I wonder if anyone knows how to convert these clickable links into protected adresses (I know you can't protect an e-mailadress for 100%, but encoding it a bit can help for a huge part off all the
harvest spam).


Simply stop displaying e-mail addresses at your site. Map all your
e-mail addresses to an integer, and then display the integer. If the
visitor then sends an e-mail, lookup the address associated witht

that number. This way you can also perform "float-control".

For this site specially I need an idiot proof system. Therefore I was
thinking about this very simple textarea where someone enters a text
(sometimes with an e-mailaddress within the text) and then replace the
e-mailaddy with this mailto-link.
I know it wouldn't stop all the spam. These people are also checking a
catch-all (because their target group makes mistakes within the
adresses all the time), but all the little thing might help.
I'll try another approach.

evelyne

Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.