Welcome Guest, Not a member yet? Register   Sign In
CI 2.0 no $_POST on specific host
#1

[eluser]mlinuxgada[/eluser]
Hi guys,
I've a very specific problem, similar to http://ellislab.com/forums/viewthread/84230/#430652 . So on my local env everything works fine /gentoo with apache2 + php5 latest stable releases/, on Win7 with xampp again it's ok.

My form is like :
Code:
<form name="setRefresh" method="post" action="/main/refresh/" >
    <label> Auto Refresh</label>
    &lt;input type="text" name="refresh" value="&lt;?php echo $this-&gt;session->userdata('refresh'); ?&gt;" maxlength="4" size="4"/>
    <button type="submit" class="set" >Set</button>
&lt;/form&gt;
The piece of the controller is :
Code:
class Main extends CI_Controller {

    public $refresh = 60;

    public function __construct() {
        parent::__construct();
        if (!$this->session->userdata('refresh')) {
            $data = array(
                'refresh' => $this->refresh
            );
            $this->session->set_userdata($data);
        }
        $this->load->model('tracker_model');
        $this->output->enable_profiler(TRUE);
    }
    .
    .
    .
    .
    public function refresh() {
        echo '<pre>'; print_r($_POST); echo '</pre>'; die(); // tried also with $this->input->post('refresh')
        
    }
}
and my .htaccess file as follows:
Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
    ErrorDocument 404 /index.php
</IfModule>
The piece from config.php :
Code:
$config['uri_protocol']    = 'AUTO';
Mod_rewrite is fine, i don't have problems with uri segments.
And whatever I try to post I have an empty $_POST arr. How should i proceed.
Grats.
PS: When I tried on the same host with simple form submit /without using CI/ I have the correct $_POST result.
#2

[eluser]mlinuxgada[/eluser]
The resolution was simple /as expected ;-)/. Thanks.




Theme © iAndrew 2016 - Forum software by © MyBB