David,

On 11/21/2003 at 08:20, you wrote:

DA> On a website, I would like to have all displayable email addresses
DA> as image files instead of text so that spammers cannot parse and
DA> capture them.

Have you tried the simpler approach of escaping all characters with
unicode equivalents?

http://cflib.org/udf.cfm?ID=405

If that doesn't suit your needs, maybe something like this (untested):

<cfscript>
        emailaddr="[EMAIL PROTECTED]";
        initlen=len(emailaddr);
        maskedemailaddr="";
        for(i=1; i lte initlen; i=i+1){
                thischar=left(emailaddr,1);
                if(thischar neq ".")){thisimage=thischar;}else{thisimage="period";}
                maskedemailaddr=maskedemailaddr&'<img src="">                 emailaddr=right(emailaddr,(len(emailaddr)-1));
        }
        writeoutput(maskedemailaddr);
</cfscript>

Not sure what other characters besides periods are illegal as file
names...

Store 'maskedemailaddr' in your database (if you are using one) so
you're not running this code per page request. Variable scopes would
speed things up if running this per request.

~ Ubqtous ~

[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to