I have a simple login page and the URL structure is like http://www.mydomain.com/admin/auth
I had a problem several days ago where the $_POST had always been empty, so i googled and found http://codeigniter.com/forums/viewthread/191918/ which suggested to change my config.php from:
$config['uri_protocol'] = 'REQUEST_URI';
to
$config['uri_protocol'] = 'PATH_INFO';
And finally it worked but only when i add index.php on the URL like this:
http://www.mydomain.com/index.php/admin/auth
I tried to make the $_POST work without having index.php on the URL but i couldn’t figure it out. My .htaccess is:
RewriteEngine on
RewriteCond $1 !^(index.php|assets|user_guide|robots.txt)
RewriteRule ^(.*)$ index.php/$1 [L]
All i need to do is for the $_POST to work on my URL, is there any workout or workaround? Thank you for your time.
EDIT:
Here is my controller (i reduced so it only loads the view, for debugging)
public function index()
{
$this->load->view('admin/login');
}
And my view has been reduced to this:
<?php var_dump($_POST); ?>
<html><head></head><body>
<form method='POST'>
<input type='text' name='nama' value='test'>
<input type='submit' value='Submit'>
</form>
</body></html>
And this code works perfectly fine on a single file i made on my server without CI.
Figured it out, it got something to do with my subdomain. When i disable the subdomain it all works fine, it seems to have something with the htaccess of subdomain and CI. Thank you for you time all 🙂