473,799 Members | 3,270 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hiding email addresses - rot13

Nel
Before I try and reinvent the wheel, can anyone help me with a basic routine
to hide email addresses from harvesting.

I currently use pull my page content from a db and run this ereg_replace:
$pagetext=ereg_ replace('[A-Za-z0-9_]([-._]?[A-Za-z0-9])*@[A-Za-z0-9]([-.]?[A
-Za-z0-9])*\.[A-Za-z]+', '<a href="mailto:\\ 0"><font
color="#0000FF" ><b>\\0</b></font></a>', $pagetext);

This simply replaces any emails within the page text with an <a> tag.

What I would like to do is replace it with:
<script language="JavaS cript">
document.write( rot13('<n
uers=\"zn**@rkn zcyr.pbz\">zn** @rknzcyr.pbz</n>'));
</script>

So, somehow I need to PHP's str_rot13() on the email addresses before the
ereg_replace. If anyone can suggest a solution I would be grateful.

Nel
Jul 17 '05 #1
8 2821
"Nel" <ne***@ne14.co. NOSPAMuk> wrote in message
news:r6******** *************@w ards.force9.net ...
Before I try and reinvent the wheel, can anyone help me with a basic routine to hide email addresses from harvesting.

I currently use pull my page content from a db and run this ereg_replace:
$pagetext=ereg_ replace('[A-Za-z0-9_]([-._]?[A-Za-z0-9])*@[A-Za-z0-9]([-.]?[A -Za-z0-9])*\.[A-Za-z]+', '<a href="mailto:\\ 0"><font
color="#0000FF" ><b>\\0</b></font></a>', $pagetext);

This simply replaces any emails within the page text with an <a> tag.

What I would like to do is replace it with:
<script language="JavaS cript">
document.write( rot13('<n
uers=\"zn**@rkn zcyr.pbz\">zn** @rknzcyr.pbz</n>'));
</script>

So, somehow I need to PHP's str_rot13() on the email addresses before the
ereg_replace. If anyone can suggest a solution I would be grateful.

Nel


Use preg_replace_ca llback.
Jul 17 '05 #2
Nel
"Chung Leong" <ch***********@ hotmail.com> wrote in message
news:3b******** ************@co mcast.com...
"Nel" <ne***@ne14.co. NOSPAMuk> wrote in message
news:r6******** *************@w ards.force9.net ...
Before I try and reinvent the wheel, can anyone help me with a basic

routine
to hide email addresses from harvesting.

I currently use pull my page content from a db and run this ereg_replace:

$pagetext=ereg_ replace('[A-Za-z0-9_]([-._]?[A-Za-z0-9])*@[A-Za-z0-9]([-.]?[A
-Za-z0-9])*\.[A-Za-z]+', '<a href="mailto:\\ 0"><font
color="#0000FF" ><b>\\0</b></font></a>', $pagetext);

This simply replaces any emails within the page text with an <a> tag.

What I would like to do is replace it with:
<script language="JavaS cript">
document.write( rot13('<n
uers=\"zn**@rkn zcyr.pbz\">zn** @rknzcyr.pbz</n>'));
</script>

So, somehow I need to PHP's str_rot13() on the email addresses before the ereg_replace. If anyone can suggest a solution I would be grateful.

Nel


Use preg_replace_ca llback.

I have looked at the PHP manual for preg_replace_ca llback and don't
understand how I can replace the text and then str_rot13 within the same
line. Can anyone offer a simple solution using my original ereg string?

Whilst I am at it, is there a better, quicker or easier way to hide an email
address from harvesters?

Nel
Jul 17 '05 #3
I noticed that Message-ID: <nG************ *********@wards .force9.net>
from Nel contained the following:
Whilst I am at it, is there a better, quicker or easier way to hide an email
address from harvesters?


Yup. Use a response form.

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #4
Nel
"Geoff Berrow" <bl******@ckdog .co.uk> wrote in message
news:72******** *************** *********@4ax.c om...
I noticed that Message-ID: <nG************ *********@wards .force9.net>
from Nel contained the following:
Whilst I am at it, is there a better, quicker or easier way to hide an emailaddress from harvesters?


Yup. Use a response form.


I would really like to keep the email address visible to the reader, but
make it hard for spambots.
<script language="JavaS cript">
<!--
var name = "test";
var domain = "email.com" ;
document.write( '<a href=\"mailto:' + name + '@' + domain + '\">');
document.write( name + '@' + domain + '</a>');
//-->
</script>

This would do if I could generate this on the fly from php.

Nel
Jul 17 '05 #5
I noticed that Message-ID: <DD************ *********@wards .force9.net>
from Nel contained the following:
Yup. Use a response form.


I would really like to keep the email address visible to the reader, but
make it hard for spambots.
<script language="JavaS cript">

Any solution requiring javascript will also make it hard for anyone
browsing with high security.
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #6
Nel

"Geoff Berrow" <bl******@ckdog .co.uk> wrote in message
news:u1******** *************** *********@4ax.c om...
I noticed that Message-ID: <DD************ *********@wards .force9.net>
from Nel contained the following:
Yup. Use a response form.


I would really like to keep the email address visible to the reader, but
make it hard for spambots.
<script language="JavaS cript">

Any solution requiring javascript will also make it hard for anyone
browsing with high security.


I must admit, I did worry about that a bit. What about a way to change the
email address in to html special chars?
e.g.
<a
href="mailto:%7 4%65%73%74%40%6 5%78%61%6d%70%6 c%65%2e%63%6f%6 d">te&
#115;t@example. co&#1
09;</a>

I can write a script to do this where $email =
emailhide("te** @example.com"); but not sure how to do this for multiple
emails withing a text string.

Nel
Jul 17 '05 #7
I noticed that Message-ID: <Eq************ *********@wards .force9.net>
from Nel contained the following:
Any solution requiring javascript will also make it hard for anyone
browsing with high security.


I must admit, I did worry about that a bit. What about a way to change the
email address in to html special chars?


Depends on what is being used to harvest the addresses. If a browser
can parse it then it's conceivable that this facility may be written
into the harvester. I'd say even more likely because such obfuscation
must mean a valid address.

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #8
Regarding this well-known quote, often attributed to Nel's famous "Wed, 28
Apr 2004 11:02:43 +0100" speech:
"Geoff Berrow" <bl******@ckdog .co.uk> wrote in message
news:u1******** *************** *********@4ax.c om...
I noticed that Message-ID: <DD************ *********@wards .force9.net>
from Nel contained the following:
Yup. Use a response form.

I would really like to keep the email address visible to the reader, but
make it hard for spambots.
<script language="JavaS cript">

Any solution requiring javascript will also make it hard for anyone
browsing with high security.


I must admit, I did worry about that a bit. What about a way to change the
email address in to html special chars?
e.g.
<a
href="mailto:%7 4%65%73%74%40%6 5%78%61%6d%70%6 c%65%2e%63%6f%6 d">te&
#115;t@example. co&#1
09;</a>

I can write a script to do this where $email =
emailhide("te** @example.com"); but not sure how to do this for multiple
emails withing a text string.

Nel


I've always liked using a "gatekeeper " page. It's a simple form with a
button, maybe a textbox and a simple question. They fill it in, or just
click the button, they get the email address. I've even put some simple
onload javascript in there that automatically submits the form. People with
JS on just see a small blip before the page hits. Most spambots won't
bother with it, since time is money, and who cares.

--
-- Rudy Fleminger
-- sp@mmers.and.ev il.ones.will.bo w-down-to.us
(put "Hey!" in the Subject line for priority processing!)
-- http://www.pixelsaredead.com
Jul 17 '05 #9

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

Similar topics

2
3339
by: Hoang | last post by:
anyone know of an algorithm to filter out real email addresses as opposed to computer generated email addresses? I have been going through past email archives in order to find friends email address. Unfortunately about 75% of them are junk addresses or spammer addresses. It's quite obvious when you look at it and delete it... but you don't want to do it by hand.
117
11897
by: Steevo | last post by:
Any suggestions as to the best programs for cloaking email addresses? Many thanks -- Steevo
4
5192
by: web_design | last post by:
I put this together from some other scripts I am using on a site. I'm trying to make a better email hiding script. It isn't working. Also, it causes Internet Explorer 6 SP2 to block the script as "active content". :( The idea is that if the user doesn't have JavaScript enabled, they will see an image of the email address (that can't be read by email harvesting programs). If JavaScript is enabled, the image will be hidden and the...
15
4493
by: Eirik | last post by:
This is a little function I wrote, inspired by the thread "Urgent HELP! required for Caesar Cipher PLEASE" $ cat /home/keisar/bin/c/ymse/rot13.h char rot13(char character) { int changed; changed = character - 'a' + 'n'; return changed;
3
1627
by: me | last post by:
Is there code out there to truly hide email addresses from view source or spiders(crawlers etc). TIA Aaron
3
2879
by: g0c | last post by:
hi, how to hide or replace email addresses in php mail function with something like "group" so the email addresses to which email is sent are not visible ? i have : $subs = "email1@dot.com, emai2@dot.com, email3@dot.com" $header .= "To : email@notset.com\r\n";
16
2534
by: Andy Dingley | last post by:
I'm trying to write rot13, but to do it in a better and more Pythonic style than I'm currrently using. What would you reckon to the following pretty ugly thing? How would you improve it? In particular, I don't like the way a three-way selection is done by nesting two binary selections. Also I dislike stating the same algorithm twice, but can't see how to parameterise them neatly. Yes, I know of .encode() and .translate(). No, I...
1
2325
by: RLN | last post by:
I have a form that is set to "continuous forms" view. Several rows of data are shown to the user at the same time. I want to set FieldX and FieldY to true and show them only if the txtEmailAddress control is not null and contains an address. Some rows shown in the detail section of the form will have email addresses, some will not. If a row doesn't have an email address, FieldX & Y's visible property must be set to false.
103
4156
by: chochote | last post by:
Hi, I have a PHP script that does some processing, and stores an error message as a variable. The script then redirects to another script with the error string in the URL, with the second script displaying the message and continues with the rest of the logic. Now I want to hide the error message from the URL, but the second script needs to continue working as is. How can I do this? I have thought about md5'ing the message but the URLs...
0
10490
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10238
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9077
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7570
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6809
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5589
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3761
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.