473,241 Members | 1,516 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,241 software developers and data experts.

ereg_replace safe e-mailadress

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
3 1602
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Roland Sippel | last post by:
Is there anything change in "ereg_replace()" PHP > 4.3.2. Scripts works in PHP 4.3.1 but NOT in PHP 4.3.2: $text = "<!-- test -->"; $text = ereg_replace("]+"," ",strip_tags($text)); echo $text...
2
by: Chris | last post by:
Hello, I use a javascript ticker in my header which contains the news in a array like that tickercontents='Message1' tickercontents='Message2' tickercontents='Message3' now i want to write an...
4
by: knocte | last post by:
Hello. I am testing this curious code and I don't understand yet why it doesn't work with the 2nd case: Case 1: $number = "2,4"; $number = ereg_replace(",",".",$number); echo $number; //...
0
by: Sean Pinto | last post by:
i am designing a search engine for our website. i want to allow for searchablity based on partial string match as well as quoted exact matches. for example the search search text many would...
3
by: Xaradas | last post by:
Someone could tell me why preg_replace eat a slash when it do replacement? <? $stringToReplace = "blah blah {nome} blah blah"; $replacement = "Two slash: \\\\"; $stringToReplace =...
0
by: pieterprovoost | last post by:
Hi, I would like to use the ereg_replace() function to replace wiki-like syntax, for example: ] becomes <a href="index.php?page=somepage">somepage</a> **hello** becomes <i>hello</i>
1
by: tmcp | last post by:
Hello I'm a bit new to regular expressions and I'm having a problem I'm trying to strip any code which is inside a <p> tag for instance from <p style="margin: 0in 0in 0pt;" class="MsoNormal"> to...
2
by: encepif | last post by:
I think this is the right command., could someone please show me how to replace instances of a quote like this " with its html version - &quot;. I am mixed up with the escaping, etc. Thank you :-) ...
6
by: chromis | last post by:
Hi, I'm trying to remove line breaks from a user-inputted string and trying to do this using ereg_replace and a regular expression but struggling, hope someone can help! I would like to make...
5
by: Hugh Oxford | last post by:
I have a string that has been saved in a database from a textarea form field. e.g. $text = "Dear %name The date is %date yours,
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.