This content has been marked as final. Show 4 replies
Redirection with POST method is not possible by HTTP specification. If you need to pass parameters, attach them to URL, if you can. Otherwise, the processing logic has to be changed.
That is odd. If I can do that within the <form action="file.cfm> tag and have a submit button that user can press redirect to file.cfm with a POST, why can't I do taht in code?
It just seems like I should be able too.
> That is odd. If I can do that within the <form action="file.cfm> tag and have a
> submit button that user can press redirect to file.cfm with a POST, why can't I
> do taht in code?
> It just seems like I should be able too.
Depends on what you are really trying to do, and what you are willing to
live with as side affects.
But I have in the past created a page that created a form and then with
<form name="theForm" action="foobar.cfm" method="post" ...>
<input type="hidden" name="aName" value="#aValue#">
But if we had a clear idea of what requirement you are filling, we maybe
able to give you better alternatives.
Well, the idea is that I should post all the information to the same page for validation and then redirect it to another page with the same information posted. Although most people would use session or cookies, I prefer not too if I can avoid it.
If I posted the information to the next page I have a problem. If there is an error next page and there is a problem I have to re-direct back to the previous page again (with a POST), but then I'm running into the same problem. I do not want to toggle the screen with two different possible views of same page (i.e. <cfif error> then display this <cfelse> display this </cfif>)
The bottom line is with a manual post and redirect I can navigate around my site anyway I want without what I consider little hacks.