SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Enthusiast daliren's Avatar
    Join Date
    Oct 2001
    Posts
    68
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question hiding email addresses from spammers

    I maintain an online directory of psychotherapists that provides contact information to users and am trying to figure out a way to disguise members' email addresses in the html. I have already built an interface for my contact at the site to enter member information. Currently, they simply enter the email address into the corresponding text-box and the address is stored in MySQL verbatim. I would like to make it so that if, say "me@mail.com" is entered, "&*109;&*101;etc... is what actually gets stored in the database, which of course will display as the former in browsers, but as the latter to spiders and bots, hence reducing spam. Has anyone done something similar to this?

    * I changed "#" to "*" so you could see what I am trying to do.
    cheers,

    Darren Cassidy

  2. #2
    SitePoint Addict
    Join Date
    Apr 2002
    Location
    Whitehorse, Yukon
    Posts
    226
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not quite what you asked for, but it might be worth the time to check this out:

    http://www.hiveware.com/enkoder_form.php

    Made for Mac OS X, so if you're a Windows-type, maybe you've got a friend with a Mac that you can do the work on.

    Just an idea.

    geof

  3. #3
    SitePoint Addict
    Join Date
    Mar 2003
    Location
    Germany
    Posts
    216
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In my experience it's always best to store values "verbatim" in the database, because you retain more flexibility. You can scramble the adress in the output stage. When you retrieve the values from the db, you might put them through a regex replacing all values with their unicode equivalent. Another easy option would be to use the Smarty template system, which has email scrambling built in.

  4. #4
    SitePoint Wizard Mincer's Avatar
    Join Date
    Mar 2001
    Location
    London | UK
    Posts
    1,140
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mkrz
    In my experience it's always best to store values "verbatim" in the database, because you retain more flexibility. You can scramble the adress in the output stage.
    I agree. It's also a lot easier if you're doing and database maintenance if the data is in raw format, or if you want to do a quick command-line query to get some info. If your've stored scrambled data, or code that's been pre-formatted, it becomes difficult to read from a humn perspective.

    Matt.

  5. #5
    Sidewalking anode's Avatar
    Join Date
    Mar 2001
    Location
    Philadelphia, US
    Posts
    2,205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Geof Harries
    Not quite what you asked for, but it might be worth the time to check this out:

    http://www.hiveware.com/enkoder_form.php

    Made for Mac OS X, so if you're a Windows-type, maybe you've got a friend with a Mac that you can do the work on.
    Only the executable is Mac-only, the web-based version you linked to is cross-platform.
    TuitionFree a free library for the self-taught
    Anode Says... Blogging For Your Pleasure

  6. #6
    Free me php klassicd's Avatar
    Join Date
    Sep 2001
    Location
    San Diego
    Posts
    509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    user at domain dot com

    just like php.net?

  7. #7
    midnight coder
    Join Date
    Dec 2000
    Location
    The flat edge of the world
    Posts
    838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This must be the 3rd time I've posted this now:
    PHP Code:
    <?
    function freddyMakesHex($str)
    {
    if (
    $str == '') {
    return;
    } else {
    $num strlen($str);
    $newStr '';
    for(
    $i=0;$i<$num;$i++) {
    $t substr($str,$i,1);
    $newStr .= "%".dechex(ord($t));
    }
    }
    return 
    $newStr;
    }
    $email 'robo@example.com';
    echo 
    $email.'<br />';
    $email freddyMakesHex($email);
    echo 
    $email.'<br />';
    echo 
    '<a href="mailto:'.$email.'">mail link</a>';
    ?>
    View source, the email link works with all the browsers I know about
    Work smarter, not harder. -Scrooge McDuck

  8. #8
    midnight coder
    Join Date
    Dec 2000
    Location
    The flat edge of the world
    Posts
    838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hope you don't mind the lack of tabs...stupid new text area loses the tabs after editing a post
    Work smarter, not harder. -Scrooge McDuck

  9. #9
    SitePoint Member
    Join Date
    Oct 2003
    Location
    australia
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    eureka i've been getting 1000 e-mails a week from bots. haha know we will stop em dead in the tracks.

  10. #10
    SitePoint Addict
    Join Date
    Apr 2002
    Posts
    330
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Manuel Lemos

    Metastorage - Data object relational mapping layer generator
    PHP Classes - Free ready to use OOP components in PHP


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •