Revision c06630b1-0cac-4551-ba95-5ec378cbdcb5 - Stack Overflow
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>
1. I tried to check the data post in Browser and it shows the data that I input in the input box.
[![enter image description here][1]][1]
2. 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] =>
)
3. 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 Once page loaded, If i edit the name of the input time 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. Dont know why?
[1]: https://i.sstatic.net/JPatn.png