Re: Email Obfuscation Function

This WebDNA talk-list message is from

2008


It keeps the original formatting.
numero = 70250
interpreted = N
texte = On May 15, 2008, at 6:18 AM, Clint Davis wrote: > I found a nice PHP function that obfuscates email addresses to > prevent spam bots from harvesting. I'm trying to re-create this > function for WebDNA, but I'm having some trouble translating. Would > anyone like to help? Here's the PHP... > > > function getEmail($emailAddress,$linkText) > { > $email = getOrdString('mailto:'.$emailAddress); > $label = getOrdString($linkText); > return "{$label}"; > } > function getOrdString($string){ > for($i=0;$i { > $bit = $string[$i]; > $output .= '&#'.ord($bit).';'; > }return $output; > } > > The function converts the mailto address and the label for it into numeric character references by looking up the decimal ASCII code for each character and then tacking on an ampersand and number sign (&#) before and a semi-colon after. To do this in WebDNA, I would use ConvertChars with a custom database that just converts ASCII characters into their numeric character references (so "a" would be converted to "a" and b would be converted to "b" and so on). I don't have such a db but I bet somebody on the list would. Hope that answers the question. -- Dana ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Email Obfuscation Function ( Colin Sidwell 2008)
  2. Re: Email Obfuscation Function ( Dana Keil 2008)
  3. Re: Email Obfuscation Function ( Clint Davis 2008)
  4. Re: Email Obfuscation Function ( Donovan Brooke 2008)
  5. Re: Email Obfuscation Function ( Clint Davis 2008)
  6. Re: Email Obfuscation Function ( "Michael A. DeLorenzo" 2008)
  7. Re: Email Obfuscation Function ( Dana Keil 2008)
  8. Email Obfuscation Function ( Clint Davis 2008)
On May 15, 2008, at 6:18 AM, Clint Davis wrote: > I found a nice PHP function that obfuscates email addresses to > prevent spam bots from harvesting. I'm trying to re-create this > function for WebDNA, but I'm having some trouble translating. Would > anyone like to help? Here's the PHP... > > > function getEmail($emailAddress,$linkText) > { > $email = getOrdString('mailto:'.$emailAddress); > $label = getOrdString($linkText); > return "{$label}"; > } > function getOrdString($string){ > for($i=0;$i { > $bit = $string[$i]; > $output .= '&#'.ord($bit).';'; > }return $output; > } > > The function converts the mailto address and the label for it into numeric character references by looking up the decimal ASCII code for each character and then tacking on an ampersand and number sign (&#) before and a semi-colon after. To do this in WebDNA, I would use ConvertChars with a custom database that just converts ASCII characters into their numeric character references (so "a" would be converted to "a" and b would be converted to "b" and so on). I don't have such a db but I bet somebody on the list would. Hope that answers the question. -- Dana ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Dana Keil

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Logging purchases (1997) webcat method for waiting specific amount of time? (2000) forms and variables (1998) SendTo more emails (1998) Running _every_ page through WebCat ? (1997) WC2b12: Yes, Formulas.db is for real (1997) Email notification to one of multiple vendors ? (1997) Orders coming up blank (2004) ISAPI WC6a and Windows 2003 Web Edition (2006) Searchable archives gone again??? (2000) Summing fields (1997) Reporting form.. (2001) WebCat B13 Mac CGI -- Frames question (1997) Re:Emailer Set Up (1997) wee problem (2001) WebCatalog/WebMerchant 2.1 (1998) Blog Software (2006) WebDNA problems with Itools 7.3 Upgrade (2004) Forum - Test Request (2005) wc 2 pro users - sites, quotes wanted (1997)