FORM variables missing after post
Copy link to clipboard
Copied
Hi Guys,
I have the most frustrating problem which occurs randomly. It also happens across multiple websites written in different ways.
Firstly here are the specs for my server
Microsoft Server 2008 running IIS 7
Coldfusion 8.0.1 (no hotfixes installed) Standard Edition
JVM ver 1.6.0_04
Form variables are randomly disappearing. I will post the form and sometimes a specific form variable will just not be recognised by the receiving page.
There is no incorrect naming on my part and the forms are set to use post.
Is there some kind of bug in CF 8 which is eating my Form variables.
Copy link to clipboard
Copied
Hi Gerard,
Can you please post your code here?.
Also what happens when you use <cfdump var="#form#"> in the posting page?. Are you able to get all the form scoped variables/values?.
Copy link to clipboard
Copied
Check your webserver logs. I've seen it happen where right after your page loads, it is requested again, but without a form scope. I don't know how to fix it, but it might be happening to you.
Copy link to clipboard
Copied
If you look @ the actual HTTP traffic (via HttpAnalyzer or Firefox's Life HTTP Headers plug-in or something similar), is the form data being passed correctly by the browser? Or - as Dan suggests - is there more HTTP traffic going on that you're expecting?
I've not heard of any such bug in CF (and everyone would be complaining about it if there was!), so I reckon the bug's more likely to be with your code or web server config or summat like that.
--
Adam
Copy link to clipboard
Copied
Thanks for your input guys, I am going to try your suggestions, will update if I find out what it is.
Copy link to clipboard
Copied
Well, a little more investigation has revealed that for some reason, when the form is submitted the request is sent as get.
This must surely mean it's a browser problem as I have set the method as post.
I will investigate further and post here what I find.
PS: Browser used was firefox 3.5, will now test in others.
Copy link to clipboard
Copied
I am an epic loser!
Apparently I forgot to close one input tag with a / so.
<input type="text" name="captchaCodeStr" id="captchaCodeStr" size="8" maxlength="4" >
Causes some browsers (IE 6 and Firefox tested) to send through the form as a get request.
Doing this stops this from happening.
<input type="text" name="captchaCodeStr" id="captchaCodeStr" size="8" maxlength="4" />
This is the lamest thing that has ever happend to me as a web developer. It is so embarrasing for it to be caused by improper html formatting.
My doctype is set as the following
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
My humblest apologies to the great CF, it was not your fault, you never received the form properly
PS: IE 7 and Chrome functioned perfectly with without the /
Copy link to clipboard
Copied
Gerard Matthews wrote:
I am an epic loser!
Apparently I forgot to close one input tag with a / so.
<input type="text" name="captchaCodeStr" id="captchaCodeStr" size="8" maxlength="4" >
Causes some browsers (IE 6 and Firefox tested) to send through the form as a get request.
Strange.
There is nothing in HTML that requires a tag to be closed like that. I have never heard of a browser caring about that sort of thing (even with an XHTML strict doc type).
Are you sure nothing else had changed as well?
--
Adam
Copy link to clipboard
Copied
NOT AGAIN!!!
IT'S BACK!!!
It appears that my previous post was not the solution. It just happend to temporarily work right after I changed something, it worked multiple times so I thought I had it.
Adam your comment that it was strange was quite on the money. It was only strange until I logged onto the website and tried it again and it did the same thing.
Back to debugging.
PS: Is there any way to mark this question as unanswered again?
Copy link to clipboard
Copied
I have some new info
Okay, the basics are the following, visit a page with a form in it. Form is posted to a handling cfm file located in another folder.
I have used HTTPAnalyser and what is happening is there is a 302 redirect happening after form submission. This is therefore doing a GET request to the processing page and there are then no FORM variables anymore.
The funnny thing is it only happens once per session. If you use the same browser window and got back to the form (by retyping address) it will now post the form to the processing page with no 302 redirect.
I have attached a screen shot of the redirect. It is being redirected by something called "NetCache appliance (NetApp/6.1.1D8)"
This only happens with firefox and IE 6.
Copy link to clipboard
Copied
I give up, thought I fixed it again but it is not. It's an old site anyway so I'm going to just migrate to the next version.
Copy link to clipboard
Copied
I suspect this is the real answer. You need to track down that NetCache appliance and know what it is doing. It sounds like some type of firewall and|or proxy device that maybe messing up your application. If there is something between your browser and your webserver turning some of your requests into gets, there is no coding change you can do that will stop this from handling. You can write CF to accept data as either FORM or URL, which isn't all that difficult. Otherwise there is little you can do without knowing what this device is doing.

