Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Protected e-mail addresses
#1
This filter plugin protect all e-mail addresses automaticly over the complete website content.
Reply
#2
Hi,

it would be nice, if you would explain how it works and what it does exactly. Otherwise others may not want to use it, because the can't figure out what it does.

Anyway, looks like it uses
Code:
str_replace(array('@','.'),array(' [at] ',' [dot] '),$email);
and also javascript is used.
Reply
#3
PHP encrypts your E-mail address in website content and generates the javascript that decrypts it. Most bots and spiders can't execute javascript and that is what makes this work. A visitor of your web page will not notice that you used this script as long as he/she has javascript enabled. The visitor will see "your-email-address [AT] example [DOT] com" in stead of the E-mail address if he/she has javascript disabled.


Function convert_mail():

Set up a regex constant to split an email address into name and domain parts.
(See - http://de.wikipedia.org/wiki/E-Mail-Adresse)

Part 1 : Match the name part - dash, dot or characters.
Followed by a @ sign.
Part 2 : One or more letters or dashes followed by a dot.
The whole thing one or more times with between two and six letters at the end. (NB .museum)
Part 3 : An optional ? followed by subject, bcc, cc or body.
The email regexp is case insensitive and ignores whitespace.

Next set up a regex for mailto: URLs.
(See http://www.faqs.org/rfcs/rfc2368.html)
This captures the name into the first group and the domain into the second.


Example:

javascript ON: info@excample.com

javascript OFF: info [AT] excample [DOT] com

source code:
Code:
<span id="e804265553">
&#x69;&#x6e;&#x66;&#x6f;&#x20;&#x5b;&#x61;&#x74;&#x5d;&#x20;&#x65;&#x78;&#x63;&#x61;&#x6d;&#x70;&#x6c;&#x65;&#x20;&#x5b;&#x64;&#x6f;&#x74;&#x5d;&#x20;&#x63;&#x6f;&#x6d;</span>
<script type="text/javascript">
/*<![CDATA[*/
document.getElementById("e804265553").innerHTML=unescape('%3c%61%20%68%72%65%66%3d%22%6d%61%69%6c%74%6f%3a%69%6e%66%6f%40%65%78%63%61%6d%70%6c%65%2e%63%6f%6d%22%3e%69%6e%66%6f%40%65%78%63%61%6d%70%6c%65%2e%63%6f%6d%3c%2f%61%3e')
/*]]>*/
</script>

This script was inspired by http://www.maurits.vdschee.nl/php_hide_email/
Reply
#4
rainman: mails generated with user [AT] domain [DOT] tld are catched pretty easily by crawlers, and those encoded with hexadecimal values as catched by a bit more sophisticated harvesters.

I found out a way of protecting e-mail address using css, and this method works.
Anyway, nice to see a useful plugin Smile
Addons: blue business theme, Online Visitors, Notepad
Reply




Users browsing this thread: 1 Guest(s)