I'm working with Codeigniter. I have created an HTML form which post data to the Controller.
This Form was working perfectly but it suddenly stopped posting data.
HTML:
<form name="frm_search" id="frm_search" method="post" action="http://ip/free/index.php/taskdetails/tabOne/1/ShibNo/asc/">
<input id="order1" name="order1" value="26" type="text" >
<input id="item1" name="item1" value="" type="text" >
</form>
- I tried to check the data post in Browser and it shows the data that I input in the input box.
- In My index.php I placed the following code to see if it is posted:
echo "CONTENT_TYPE: " . $_SERVER['CONTENT_TYPE'] . ""; $data = file_get_contents('php://input'); echo "DATA: <pre>"; var_dump($data); var_dump($_POST); echo "</pre>"; exit;
RESULT:
CONTENT_TYPE: application/x-www-form-urlencoded
string 'order1=26&item1='
array (size=23)
'order1' => string '26' (length=2)
'item1' => string '' (length=0)
But when I print $_POST in controller I get the following:
Array
(
[order1] =>
[item1] =>
)
My .htaccess code as follows:
RewriteEngine on RewriteCond $1 !^(index\\.php|resources|robots\\.txt) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L,QSA]
Can someone tell me what's the issue? I'm not able to find out why is it when the data passes to controller it becomes null. The application was running successfully for more than a year but I got this issue suddenly.
Thank you in advance. Kindly let me know if you need any more to help me.
Note: I figured out that once the page is loaded, If I edit the name of the input to some other name then the data is post successfully.
i.e: instead of order1, If I change the name my editing using inspect element in Chrome to "neworder" Then if I submit, the data submits with value to controller. Don't know why?
Update: I found some this strange. In the set-cookie of the browser. It's like a full page of junk.
Each time when the page is called i start a new session but i wont kill the existing session. Is that a problem?
Even If i destroy the old session and start new one I get eh set-cookies in browser. It has to me one.. but in my case I get more than 6 set cookies in the browser.

order1 = HELLO. What doesecho $this->input->post('order1');produce?$('#order1').val('');or anything like that?