Register   Login       Forum   Search   Help  

Post new topic Reply to topic
The Web Hosting Forum > Programming & Technical > Love Thy Users

Author Thread
Euler



Joined: 02 Sep 2004
Posts: 109
Love Thy Users  Reply with quote  

Here's a subtle and effective way to love your users in php.

Most forums/blogs/webapps provide optional contact info for users. For instance, here on h4m you can set your acct so that when people view your profile, they get a mailto link pointing at your email address.

The down side is that the blind among us craft spiderbots to harvest these mailto address and sell them to spammers.

Here is a way to transparently break their bots. The blind will eventually adapt their bots in their effort to harm your users for cash. Until then, share the love!

code:

function obscure_text($text) {
   $i=0;
   do {
      $codechar =  substr($text,$i,1);
      $code = ord($codechar);
      if($code != "&#0") {
         $cryptxt = $cryptxt."&#$code";
      }
      $i++;
   } while($codechar != ""); // End of do-while loop
   return $cryptxt;
}




Now, every time your engine wants to display an email address, pump the address through this thing first. Bots will be confused and love will again transcend the selfish actions of the heedless.


Post Mon Mar 14, 2005 8:56 pm
 View user's profile Send private message
Thermit
Site Admin


Joined: 11 Aug 2004
Posts: 272
 Reply with quote  

&#110&#111&#115&#112&#97&#109&#64&#115&#101&#111&#49&#46&#110&#101&#116

Hey, that's pretty cool!

I'm gonna have to integrate that.

Most people keep their email off, but this is a great option for the brave or innocent...


Post Tue Mar 15, 2005 4:38 am
 View user's profile Send private message

Post new topic Reply to topic
Forum Jump:
Jump to:  

All times are GMT.
The time now is Sat Jul 31, 2010 8:43 pm
  Display posts from previous: