Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFHTTPPARAM problem

Status
Not open for further replies.

AMayer

Programmer
Sep 23, 2000
82
US
Here's my situation: I've been working on migrating an app from one look and feel to another and had to build an interface on top of an interface as a temporary solution. When a user posts data to my form, my program posts the information to a form on a different site. This is all working great except for one big problem...

One of the fields is a textarea field where the user typically copies and pastes a lot of information. The problem is that if the user has an & anywhere in the field, the cfhttpparam function chops off the data at the &. I can't readily think of a way to solve this.

Anyone run into this? Andrew
 
Hey AMayer,

As a temporary solution you could probably get away with a simple replace function.

Try this before you send it with cfhttpparam:

<CFSET MyTextArea = #Replace(MyTextArea,&quot;&&quot;,&quot;;and;&quot;,&quot;ALL&quot;)#>
You may need to escape the & by using && I can never remmember which characters you have to do that with.

Then on the other side do the opposite. If you cannot change the other side then you may be able to simply escape the character by replacing & with && in your code. The reason that is happening with your value in the first place probably means it is being sent on a URL at some point so when it finds & it thinks a new variable is comming and crops the string at that point. You may want to check that you are in fact using FormField method with CFHTTPPARAM it will use the Post Method which shouldn't run through the URL.

If you still have problems let me know, I'll see if I can come up with something else. :)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top