Hi all,
         sometime after IIS was patched recently on our host's server 
something went awry with CFHTTP... it's hard to explain... basically, when 
a CFHTTPPARAM  value contains an ampersand ('&'), and the CFHTTP is POSTed 
to the CF server, the receiving CF template (fusebox, but this applies to 
standard templates too) gets very confused abut field names, and values, 
specifically, it takes the text in the _VALUE_ after the ampersand and 
thinks that is a field name.  Obviously this is bad.  I have tested this 
with our systems... here are the results...

         Apache & CF5 = normal
         IIS 4 (latest patch level) & CF4.5 = broken
         IIS 5 (latest patch level) & CF5    = normal

Now I initially thought this would be an IIS problem, because I'm not fond 
of IIS really.  But I setup a standard form which did the same thing as 
CFHTTP, that is posted the data to the receiving template, and it worked OK 
where CFHTTP didn't.

I'm sure that the problem hasn't ALWAYS existed with IIS and 4.5 because I 
have only been made aware of it now as there have been 3 failures of this 
particular bit of code in the last 2 weeks and  no similar failures in the 
8 months since it was brought online.  Anybody got any idea what could be 
the problem, or more importantly how I can work around it ??  Here is my 
test code (two files, testPOST.cfm and testPOST2.cfm, change the 
LocationOfTestPost2 in testPOST.cfm as appropriate)...

== testPOST.cfm 
============================================================================================

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
         <title>Untitled</title>
</head>

<body>
         <CFSET LocationOfTestPost2 = 
"http://put.your.server.here/testPOST2.cfm";>

         <CFSET AccountDetails = StructNew()>
         <CFSCRIPT>
         AccountDetails.PrimaryDomain = "mrd.co.nz";
         AccountDetails.Q_Hosting = QueryNew("blah,foo");
         AccountDetails.DoHoDiskSpaceUnits = 0;
         AccountDetails.Q_Options = QueryNew("blah,foo");
         // These are incase the user ordered the secure system option
         AccountDetails.SSAOptions = StructNew();

         AccountDetails.SSAOptions.SSAContactName = "Blog Bar &  Foo Bar";
         AccountDetails.SSAOptions.SSAContactPhone = "123 4567";
         AccountDetails.SSAOptions.SSAContactEmail = 
"[EMAIL PROTECTED]";
         AccountDetails.SSAOptions.SSAUsername = "xxyyzz";
         AccountDetails.SSAOptions.SSAPassword = "xxzzyy";
         AccountDetails.SSAOptions.SSACustomerNumber = "DW-00631-C";
         </CFSCRIPT>

<CFWDDX ACTION="CFML2WDDX" INPUT=#AccountDetails# OUTPUT="Bork">

<CFHTTP METHOD="POST"  URL="#LocationOfTestPost2#">
                 <CFHTTPPARAM TYPE="FORMFIELD" 
NAME="FuseAction"     VALUE="addHostingTecTask">
                 <CFHTTPPARAM TYPE="FORMFIELD" 
NAME="TaOrderURL"     VALUE="http://www.yahoo.com";>
                 <CFHTTPPARAM TYPE="FORMFIELD" 
NAME="PayBy"          VALUE="Cheque">
                 <CFHTTPPARAM TYPE="FORMFIELD" 
NAME="TaOrderID"      VALUE="906">
                 <CFHTTPPARAM TYPE="FORMFIELD" NAME="TaCustomerLink" 
VALUE="DW-00631-C">
                 <CFHTTPPARAM TYPE="FORMFIELD" 
NAME="TaEditLinks"    VALUE="yada.nada.nu">
                 <CFHTTPPARAM TYPE="FORMFIELD" 
NAME="TaComments"     VALUE="#ParagraphFormat(HTMLEditFormat('blogger'))#">
                 <CFHTTPPARAM TYPE="FORMFIELD" NAME="AccountDetails" 
VALUE="#Bork#">
</CFHTTP>
<CFOUTPUT>#CFHTTP.FileContent#</CFOUTPUT>

<FORM METHOD="POST" ACTION="#LocationOfTestPost2#" 
ENCTYPE="multipart/form-data">
         <CFOUTPUT>
                 <INPUT TYPE="HIDDEN" 
NAME="FuseAction"  VALUE="addHostingTecTask">
                 <INPUT TYPE="HIDDEN" 
NAME="TaOrderURL"  VALUE="http://www.yahoo.com";>
                 <INPUT TYPE="HIDDEN" NAME="PayBy"       VALUE="Cheque">
                 <INPUT TYPE="HIDDEN" NAME="TaOrderID"   VALUE="906">
                 <INPUT TYPE="HIDDEN" NAME="TaCustomerLink" 
VALUE="#HTMLEditFormat('DW-00631-C')#">
                 <INPUT TYPE="HIDDEN" NAME="TaEditLinks" 
VALUE="#HTMLEditFormat('yada.nada.nu')#">
                 <INPUT TYPE="HIDDEN" NAME="TaComments"
                                                 
VALUE="#HTMLEditFormat(ParagraphFormat(HTMLEditFormat('blogger')))#">
                 <INPUT TYPE="HIDDEN" NAME="AccountDetails" 
VALUE="#HTMLEditFormat(Bork)#">

                 <INPUT TYPE="SUBMIT" NAME="SUBMIT" VALUE="SUBMIT">
         </CFOUTPUT>
</FORM>

</body>
</html>

== testPOST2.cfm 
============================================================================================

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
         <title>Untitled</title>
</head>

<body>

<CFSETTING SHOWDEBUGOUTPUT="Yes">
<CFOUTPUT>#FORM.FieldNames#</CFOUTPUT>
<HR>

<CFOUTPUT>#FORM.AccountDetails#</CFOUTPUT>
<HR>

</body>
</html>



----------
James Sleeman
Innovative Media Ltd
Phone: (03) 377 6262
http://www.websolutions.co.nz/

CAUTION: The information contained in this email message is confidential 
and may be legally privileged. If the reader of this message is not the 
intended recipient you are notified that any use, dissemination, 
distribution or reproduction of this message is prohibited. If you have 
received this message in error please notify the sender immediately and 
destroy the original message and any attachments.

Views expressed in this communication may not be those of Innovative Media 
Ltd.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to