We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18913
    • 654 Posts
    With the Recaptcha library in hand, it is fairly trivial to implement their email-hiding routine "MailHide."

    A snippet (in my case called "mailhide") that looks like this :
    <?php
    require_once ("assets/snippets/recaptcha/recaptchalib.php");
    // get a key at http://mailhide.recaptcha.net/apikey
    $mailhide_pubkey = '--a mailhide public key--';
    $mailhide_privkey = '--a mailhide private key--';
    
    $out = "<br><br><br><br>";
    $out .= 'The Mailhide version of [email protected] is ';
    $out .= recaptcha_mailhide_html ($mailhide_pubkey,
                                  $mailhide_privkey,
                                  "[email protected]");
    
    $out .= '<br> The url for the email is: ' . recaptcha_mailhide_url ($mailhide_pubkey,
                                 $mailhide_privkey,
                                 "[email protected]");
    $out .= '<br>';
    
    return $out;
    ?>


    produces a page like this
    http://www.considine.net/recaptcha/index.php?id=18

    If one clicks on the "..." you’ll see how the address gets revealed.

    For what it’s worth ...
    MattC
      • 33337
      • 3,975 Posts
      Thanks for contributing! laugh

      You can make a txt file/package and submit it to the extras here as well: http://modxcms.com/extras/submit-package.html
        Zaigham R - MODX Professional | Skype | Email | Twitter

        Digging the interwebs for #MODX gems and bringing it to you. modx.link
        • 29059
        • 88 Posts
        are there any instructions on how to implement this?
        i’m not a code-guy very well, so, basic instructions would be appreciated.
          • 29059
          • 88 Posts
          Please? anyone?
            • 18913
            • 654 Posts
            Can you explain what you are having trouble with? The snippet I wrote is here
            http://modxcms.com/extras/package/?package=603
            and in the example you pointed to it was implemented with a call like this
             [!mailhide!]] 


            All that snippet does is call the two recaptcha routines, one which generates a link that one can click on, the second of which generates a url one can go to retrieve the email address.

            Of course you have to have gone to the recaptcha site and gotten a key for your site and downloaded the library file I mentioned.

            Matt