Re: Hide email addresses from spam bots

From: Date: Thu, 02 Feb 2006 00:47:43 +0000
Subject: Re: Hide email addresses from spam bots
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-229685@lists.php.net to get a copy of this message
I used this procedure once on a web site - It is rather simple, but worked quite well at the time: Stop SpamBots from Harvesting email addresses Using Character Codes in Emil Addresses If you replace at least one alphabetic character on each side of the "@" symbol in all of the e-mail addresses that you list at your site, spambots probably won't be bothered to harvest them and you will notice a huge decrease in the amount of spam that you get. Browsers automatically convert these codes into their corresponding alphabetic characters, so your "mailto:" links will still function properly.
    e.g.:  Replace the letters "a" in  mailto:dlambert@iname.com
so it becomes: mailto:dlambert@iname.com
    Here are the character codes that you'll need:
    a a     b b     c c     d d    e e    f f
    g g    h h    i i    j j    k k    l l
    m m    n n    o o    p p    q q    r r
    s s    t t    u u    v v    w w    x x
    y y    z z
    You could probably come up with a script to convert ALL the
    letters in the email addy.
--
    R. Dave Lambert
From PHP Phrasebook by Wenz (Highly recommend for only $15): <?php function protectMail($s) {
    $result = '';
    $s = 'mailto:' . $s;
    for ($i = 0; $i < strlen($s); $i++) {
      $result .= '&#' . ord(substr($s, $i, 1)) . ';';
    }
    return $result;
} echo '<a href="' .
    protectMail('email@address.xy') .
    '">Send mail</a>';
?> tedd -- -------------------------------------------------------------------------------- http://sperling.com/

« previous php.general (#229685) next »