Re: Email Obfuscation Function

This WebDNA talk-list message is from

2008


It keeps the original formatting.
numero = 70251
interpreted = N
texte = I nice ASCII table can be found at http://www.dkinweb.com/ascii-characters.php Mike -----Original Message----- From: WebDNA Talk [mailto:WebDNA-Talk@talk.smithmicro.com] On Behalf Of Dana Keil Sent: Thursday, May 15, 2008 12:22 PM To: WebDNA Talk Subject: Re: Email Obfuscation Function 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/ ------------------------------------------------------------- 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)
I nice ASCII table can be found at http://www.dkinweb.com/ascii-characters.php Mike -----Original Message----- From: WebDNA Talk [mailto:WebDNA-Talk@talk.smithmicro.com] On Behalf Of Dana Keil Sent: Thursday, May 15, 2008 12:22 PM To: WebDNA Talk Subject: Re: Email Obfuscation Function 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/ ------------------------------------------------------------- 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/ "Michael A. DeLorenzo"

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:

Generating Report Totals (1997) exclusive db lock with webcat-3 ? (2000) Frames and WebCat (1997) [WebDNA] db admin tool (2008) anyone interested in doing an open-source WebCatbasedforum? (2002) WebCat2 beta 11 - new prefs ... (1997) WebCat2b12--[searchstring] bug (1997) Superfilous Characters (1998) 2 databases (1998) WebMerchant & CC Response (2002) no time stamp & different times from emailer (1998) Re:quit command on NT (1997) Country & Ship-to address & other fields ? (1997) [OT] - Block Traffic to DevBox (2003) WebDNA with WebStar V (2003) mass mailing (1998) emailer (1997) MATH TIME (1997) WC1.6 to WC2 date formatting (1997) Combining Searches (1998)