When sending form data via post method, lighthttpd returns GET method |
[eluser]christoz[/eluser]
Hello i've deployed CI 2.1.2 on lighthttpd server, i've found something strange, “strange” because i have no explanation so far, i’m trying to send form data using a POST method, i check what is the type of method using the “$_SERVER[‘REQUEST_METHOD’]” into the target controller specified in the action attribute of the form, and the server responses GET method, The form is set to send at POST array not GET.
[eluser]skunkbad[/eluser]
Maybe there is something wrong with your server, because I have multiple applications on lighthttpd, and no problems with POST.
[eluser]christoz[/eluser]
What would be the right question for the host to answer, i need to give something to take notice. Using light http headers addon, i found that lighthttpd responses with 301 header while apache with 302
[eluser]skunkbad[/eluser]
Why don't you show us the simplest cose example that fails, so we can make sure it is not your code.
[eluser]christoz[/eluser]
CI version 2.1.2 lighthttpd version Code: ["SERVER_SOFTWARE"]=> string(15) "lighttpd/1.4.31" This is the form tag generated by calling and echoing Code: form_open('admin/actions/insert/'.$cur_seg, $form_attributes); Code: <form action="http://.../.../index.php/admin/actions/insert/0" method="post" accept-charset="utf-8" class="stdform stdform2" id="form2"> .... Some input fields inside form Code: <p> This is the target controller method Code: public function insert($parent_id){ Submiting a form outside CI deployment has no problems http://www.christoz.gr/test.php Forget about the GET, the point i think is that I don't get at least 302 Header Response with an alternative url to get redirected
[eluser]skunkbad[/eluser]
What happens when you run this test controller: Code: <?php
[eluser]christoz[/eluser]
vardumb outputs Code: bool(false) print_r($_POST) outputs Code: Array header response Code: http://somedomain.gr/pinecone/index.php/test
[eluser]skunkbad[/eluser]
I'm curious about the 301 status in the header. Any idea why that is there? Perhaps that is the problem. Everything else in the header looks normal to me.
[eluser]christoz[/eluser]
w3.org explains that http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html Quote:10.3.2 301 Moved Permanently There is a notice that says Quote: Note: When automatically redirecting a POST request afterWell that's me i guess
[eluser]skunkbad[/eluser]
I know what a 301 is, but why are you redirecting the post? You should do all of your processing before the redirect. |
Welcome Guest, Not a member yet? Register Sign In |