What also works, that I've done is to replace the #'s with the ASCII char.
That way you don't have to worry about whether it'll end up being properly
escaped or not. When it's displayed the browser will translate the Char into
a Pound

The ASCII char for # is &#35

My code was <CFSET FormDetail = #Replace(FORM.Detail, "##", "&##35;")#>

That way your db just has an ASCII value where ever a pound was. Seems to
work pretty well in my app.

Hope that helps too

J.

John Wilker
Web Applications Consultant
Allaire Certified ColdFusion Developer

Office: 909-943-8428
www.billtracker.org <http://www.billtracker.org>


-----Original Message-----
From: Top-Link Tech (John Ceci) [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 16, 2001 9:58 AM
To: CF-Talk
Subject: RE: escaping #'s


Melissa,

try this:

<CFSET Body = Replace(Body,"##","####","ALL")>

HTH,
John

-----Original Message-----
From: Melissa Fraher [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 16, 2001 11:00 AM
To: CF-Talk
Subject: escaping #'s


I have a text area that submits to a message board and sends out an
email to subscribers.  When a user enters a # in the body of the message
it causes an error.

How do you escape # signs?

Here is the code that I tried:
<CFSET BODY= Replace(#Body#,"#","##","ALL")>

Here is the error that I get:
Error Occurred While Processing Request

 Error Diagnostic Information

 Just in time compilation error

 Invalid parser construct found on line 99 at position 35. ColdFusion
was looking at the following text:

 "

 Invalid expression format. The usual cause is an error in the
expression structure.

Does anyone know how to get around this?

Thanks.

Melissa
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to