Hiding email addresses - rot13

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Nel

    Hiding email addresses - rot13

    Before I try and reinvent the wheel, can anyone help me with a basic routine
    to hide email addresses from harvesting.

    I currently use pull my page content from a db and run this ereg_replace:
    $pagetext=ereg_ replace('[A-Za-z0-9_]([-._]?[A-Za-z0-9])*@[A-Za-z0-9]([-.]?[A
    -Za-z0-9])*\.[A-Za-z]+', '<a href="mailto:\\ 0"><font
    color="#0000FF" ><b>\\0</b></font></a>', $pagetext);

    This simply replaces any emails within the page text with an <a> tag.

    What I would like to do is replace it with:
    <script language="JavaS cript">
    document.write( rot13('<n
    uers=\"znvy@rkn zcyr.pbz\">znvy @rknzcyr.pbz</n>'));
    </script>

    So, somehow I need to PHP's str_rot13() on the email addresses before the
    ereg_replace. If anyone can suggest a solution I would be grateful.

    Nel


  • Chung Leong

    #2
    Re: Hiding email addresses - rot13

    "Nel" <nelly@ne14.co. NOSPAMuk> wrote in message
    news:r6wjc.3683 4$Y%6.4982857@w ards.force9.net ...[color=blue]
    > Before I try and reinvent the wheel, can anyone help me with a basic[/color]
    routine[color=blue]
    > to hide email addresses from harvesting.
    >
    > I currently use pull my page content from a db and run this ereg_replace:
    >[/color]
    $pagetext=ereg_ replace('[A-Za-z0-9_]([-._]?[A-Za-z0-9])*@[A-Za-z0-9]([-.]?[A[color=blue]
    > -Za-z0-9])*\.[A-Za-z]+', '<a href="mailto:\\ 0"><font
    > color="#0000FF" ><b>\\0</b></font></a>', $pagetext);
    >
    > This simply replaces any emails within the page text with an <a> tag.
    >
    > What I would like to do is replace it with:
    > <script language="JavaS cript">
    > document.write( rot13('<n
    > uers=\"znvy@rkn zcyr.pbz\">znvy @rknzcyr.pbz</n>'));
    > </script>
    >
    > So, somehow I need to PHP's str_rot13() on the email addresses before the
    > ereg_replace. If anyone can suggest a solution I would be grateful.
    >
    > Nel[/color]

    Use preg_replace_ca llback.


    Comment

    • Nel

      #3
      Re: Hiding email addresses - rot13

      "Chung Leong" <chernyshevsky@ hotmail.com> wrote in message
      news:3bmdnQc8hY qRfhPd4p2dnA@co mcast.com...[color=blue]
      > "Nel" <nelly@ne14.co. NOSPAMuk> wrote in message
      > news:r6wjc.3683 4$Y%6.4982857@w ards.force9.net ...[color=green]
      > > Before I try and reinvent the wheel, can anyone help me with a basic[/color]
      > routine[color=green]
      > > to hide email addresses from harvesting.
      > >
      > > I currently use pull my page content from a db and run this[/color][/color]
      ereg_replace:[color=blue][color=green]
      > >[/color]
      >[/color]
      $pagetext=ereg_ replace('[A-Za-z0-9_]([-._]?[A-Za-z0-9])*@[A-Za-z0-9]([-.]?[A[color=blue][color=green]
      > > -Za-z0-9])*\.[A-Za-z]+', '<a href="mailto:\\ 0"><font
      > > color="#0000FF" ><b>\\0</b></font></a>', $pagetext);
      > >
      > > This simply replaces any emails within the page text with an <a> tag.
      > >
      > > What I would like to do is replace it with:
      > > <script language="JavaS cript">
      > > document.write( rot13('<n
      > > uers=\"znvy@rkn zcyr.pbz\">znvy @rknzcyr.pbz</n>'));
      > > </script>
      > >
      > > So, somehow I need to PHP's str_rot13() on the email addresses before[/color][/color]
      the[color=blue][color=green]
      > > ereg_replace. If anyone can suggest a solution I would be grateful.
      > >
      > > Nel[/color]
      >
      > Use preg_replace_ca llback.
      >[/color]
      I have looked at the PHP manual for preg_replace_ca llback and don't
      understand how I can replace the text and then str_rot13 within the same
      line. Can anyone offer a simple solution using my original ereg string?

      Whilst I am at it, is there a better, quicker or easier way to hide an email
      address from harvesters?

      Nel


      Comment

      • Geoff Berrow

        #4
        Re: Hiding email addresses - rot13

        I noticed that Message-ID: <nGJjc.36967$Y% 6.5045509@wards .force9.net>
        from Nel contained the following:
        [color=blue]
        >Whilst I am at it, is there a better, quicker or easier way to hide an email
        >address from harvesters?[/color]

        Yup. Use a response form.

        --
        Geoff Berrow (put thecat out to email)
        It's only Usenet, no one dies.
        My opinions, not the committee's, mine.
        Simple RFDs http://www.ckdog.co.uk/rfdmaker/

        Comment

        • Nel

          #5
          Re: Hiding email addresses - rot13

          "Geoff Berrow" <blthecat@ckdog .co.uk> wrote in message
          news:72ru80h2ed fkf3936a2dagsor sa55sepql@4ax.c om...[color=blue]
          > I noticed that Message-ID: <nGJjc.36967$Y% 6.5045509@wards .force9.net>
          > from Nel contained the following:
          >[color=green]
          > >Whilst I am at it, is there a better, quicker or easier way to hide an[/color][/color]
          email[color=blue][color=green]
          > >address from harvesters?[/color]
          >
          > Yup. Use a response form.[/color]

          I would really like to keep the email address visible to the reader, but
          make it hard for spambots.
          <script language="JavaS cript">
          <!--
          var name = "test";
          var domain = "email.com" ;
          document.write( '<a href=\"mailto:' + name + '@' + domain + '\">');
          document.write( name + '@' + domain + '</a>');
          //-->
          </script>

          This would do if I could generate this on the fly from php.

          Nel


          Comment

          • Geoff Berrow

            #6
            Re: Hiding email addresses - rot13

            I noticed that Message-ID: <DDKjc.36973$Y% 6.5047755@wards .force9.net>
            from Nel contained the following:
            [color=blue][color=green]
            >> Yup. Use a response form.[/color]
            >
            >I would really like to keep the email address visible to the reader, but
            >make it hard for spambots.
            ><script language="JavaS cript">[/color]


            Any solution requiring javascript will also make it hard for anyone
            browsing with high security.
            --
            Geoff Berrow (put thecat out to email)
            It's only Usenet, no one dies.
            My opinions, not the committee's, mine.
            Simple RFDs http://www.ckdog.co.uk/rfdmaker/

            Comment

            • Nel

              #7
              Re: Hiding email addresses - rot13


              "Geoff Berrow" <blthecat@ckdog .co.uk> wrote in message
              news:u1uu80tsco 0e93mhh83un95e0 2rkv9l13o@4ax.c om...[color=blue]
              > I noticed that Message-ID: <DDKjc.36973$Y% 6.5047755@wards .force9.net>
              > from Nel contained the following:
              >[color=green][color=darkred]
              > >> Yup. Use a response form.[/color]
              > >
              > >I would really like to keep the email address visible to the reader, but
              > >make it hard for spambots.
              > ><script language="JavaS cript">[/color]
              >
              >
              > Any solution requiring javascript will also make it hard for anyone
              > browsing with high security.[/color]

              I must admit, I did worry about that a bit. What about a way to change the
              email address in to html special chars?
              e.g.
              <a
              href="mailto:%7 4%65%73%74%40%6 5%78%61%6d%70%6 c%65%2e%63%6f%6 d">&#116;&#101; &
              #115;&#116;&#64 ;&#101;&#120;&# 97;&#109;&#112; &#108;&#101;&#4 6;&#99;&#111;&# 1
              09;</a>

              I can write a script to do this where $email =
              emailhide("test @example.com"); but not sure how to do this for multiple
              emails withing a text string.

              Nel


              Comment

              • Geoff Berrow

                #8
                Re: Hiding email addresses - rot13

                I noticed that Message-ID: <EqLjc.36979$Y% 6.5048207@wards .force9.net>
                from Nel contained the following:
                [color=blue][color=green]
                >> Any solution requiring javascript will also make it hard for anyone
                >> browsing with high security.[/color]
                >
                >I must admit, I did worry about that a bit. What about a way to change the
                >email address in to html special chars?[/color]

                Depends on what is being used to harvest the addresses. If a browser
                can parse it then it's conceivable that this facility may be written
                into the harvester. I'd say even more likely because such obfuscation
                must mean a valid address.

                --
                Geoff Berrow (put thecat out to email)
                It's only Usenet, no one dies.
                My opinions, not the committee's, mine.
                Simple RFDs http://www.ckdog.co.uk/rfdmaker/

                Comment

                • FLEB

                  #9
                  Re: Hiding email addresses - rot13

                  Regarding this well-known quote, often attributed to Nel's famous "Wed, 28
                  Apr 2004 11:02:43 +0100" speech:
                  [color=blue]
                  > "Geoff Berrow" <blthecat@ckdog .co.uk> wrote in message
                  > news:u1uu80tsco 0e93mhh83un95e0 2rkv9l13o@4ax.c om...[color=green]
                  >> I noticed that Message-ID: <DDKjc.36973$Y% 6.5047755@wards .force9.net>
                  >> from Nel contained the following:
                  >>[color=darkred]
                  >>>> Yup. Use a response form.
                  >>>
                  >>>I would really like to keep the email address visible to the reader, but
                  >>>make it hard for spambots.
                  >>><script language="JavaS cript">[/color]
                  >>
                  >>
                  >> Any solution requiring javascript will also make it hard for anyone
                  >> browsing with high security.[/color]
                  >
                  > I must admit, I did worry about that a bit. What about a way to change the
                  > email address in to html special chars?
                  > e.g.
                  > <a
                  > href="mailto:%7 4%65%73%74%40%6 5%78%61%6d%70%6 c%65%2e%63%6f%6 d">&#116;&#101; &
                  > #115;&#116;&#64 ;&#101;&#120;&# 97;&#109;&#112; &#108;&#101;&#4 6;&#99;&#111;&# 1
                  > 09;</a>
                  >
                  > I can write a script to do this where $email =
                  > emailhide("test @example.com"); but not sure how to do this for multiple
                  > emails withing a text string.
                  >
                  > Nel[/color]

                  I've always liked using a "gatekeeper " page. It's a simple form with a
                  button, maybe a textbox and a simple question. They fill it in, or just
                  click the button, they get the email address. I've even put some simple
                  onload javascript in there that automatically submits the form. People with
                  JS on just see a small blip before the page hits. Most spambots won't
                  bother with it, since time is money, and who cares.

                  --
                  -- Rudy Fleminger
                  -- sp@mmers.and.ev il.ones.will.bo w-down-to.us
                  (put "Hey!" in the Subject line for priority processing!)
                  -- http://www.pixelsaredead.com

                  Comment

                  Working...