Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other Obfuscating e-mail addresses [anti-SPAM]

  • This topic is empty.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #25533
    Hugo
    Member

    Hi guys,

    Was wondering – how do you obfuscate the e-mail addresses on your pages? I found some really nice ideas over here:
    http://techblog.tilllate.com/2008/07/20 … -compared/
    ..but that does not cover wrapping the e-mail address in an anchor (mailto:[email protected]).. So how do you do this?

    I was actually looking for a non-javascript solution.

    Regards,

    -H

    #61250
    mattvot
    Member

    I seriously cannot be the only one ever to think of this?!!!!
    Maybe so. I just thought of this now, tested it and it works

    Make an anchor link go to something like http://in.com/email.php and in that have the address code:

    Code:

    You could even get adventurous:

    Code:

    and make the anchor link hit http://in.com/email.php?f=mattvot&d=domain&t=.com

    Here’s a more compressed version of the code above to reduce file size:

    Code:

    So your final HTML markup would look something like this:

    Or even:

    #61253
    Chris Coyier
    Keymaster

    You’d have to sanitize the shit out of those variables, but it’s an interesting idea for sure.

    #61254
    mattvot
    Member

    cool. I’ve just thought I may launch a web app, similar to tinyurl for this sort of thing when I get the time

    #61255
    danilolee
    Member

    This is what I’ve been doing to hide my email address.

    1. I utilize this CSS class (below) which reverts the orientation of the content from right to left.

    Code:
    .email {
    unicode-bidi: bidi-override;
    direction: rtl;
    }

    2. Then, I convert ASCII characters to Unicode at http://www.mikezilla.com/exp0012.html

    3. The final code looks like:

    #61257
    mvaughn
    Participant

    Chris,

    I’m a hack when it comes to PHP. I understand what’s going on with the code here but can you explain "sanitize the shit out of those variables" please?

    thx
    -Michael

    #61215
    Hugo
    Member
    "mvaughn" wrote:
    Chris,

    I’m a hack when it comes to PHP. I understand what’s going on with the code here but can you explain "sanitize the shit out of those variables" please?

    thx
    -Michael

    The PHP code from above takes GET variables and uses them to execute a bit of code, but because GET variables are very easy to manipulate you should always limit the input possibilities (‘sanitizing’). This security thingie is similar to SQL injection (the Wikipedia article explains more)


    @danilolee
    : There are crawlers/bots out there that can read out ASCII characters…


    @mattvot
    : your PHP solution sounds like something, but I’ll have to keep looking for a non-PHP solution as some of my clients have a hosting provider that does not support php :-/.
    I like your idea of the web app, I’d be glad to help you set up something for that. Just shoot me a PM.

    #61191
    bcdc_us
    Participant

    danilolee,
    You can use this PHP function I wrote to convert to ascii.

    <?php
    # http://bcdc.us
    function mailacsii($name, $domain, $link=NULL) {
    $email = $name . ‘@’ . $domain;
    if (!$link): $link = $email; endif;
    foreach (str_split($email) as $obj)
    {
    $ascii .= ‘&#’ . ord($obj) . ‘;’;
    $output = ‘<a href="mailto:’ . $ascii . ‘">’. $link .'</a>’;
    }
    return $output;
    }
    ?>
    <html>
    <!– usage examples –>
    example a) <?php echo mailacsii(‘hello’, ‘world.com’, ‘Send Email’); ?><br />
    example b) <?php echo mailacsii(‘hello’, ‘world.com’); ?>
    </html>

Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘Other’ is closed to new topics and replies.