Note that there are some explanatory texts on larger screens.

plurals
  1. POCodeIgniter $_POST Not Working With REQUEST_URI protocol
    text
    copied!<p>I have a simple login page and the URL structure is like www.mydomain.com/admin/auth</p> <p>I had a problem several days ago where the $_POST had always been empty, so i googled and found <a href="http://codeigniter.com/forums/viewthread/191918/" rel="nofollow">http://codeigniter.com/forums/viewthread/191918/</a> which suggested to change my config.php from:</p> <pre><code>$config['uri_protocol'] = 'REQUEST_URI'; </code></pre> <p>to</p> <pre><code>$config['uri_protocol'] = 'PATH_INFO'; </code></pre> <p>And finally it worked but only when i add index.php on the URL like this: www.mydomain.com/index.php/admin/auth</p> <p>I tried to make the $_POST work without having index.php on the URL but i couldn't figure it out. My .htaccess is:</p> <pre><code>RewriteEngine on RewriteCond $1 !^(index.php|assets|user_guide|robots.txt) RewriteRule ^(.*)$ index.php/$1 [L] </code></pre> <p>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.</p> <p>EDIT: Here is my controller (i reduced so it only loads the view, for debugging)</p> <pre><code>public function index() { $this-&gt;load-&gt;view('admin/login'); } </code></pre> <p>And my view has been reduced to this:</p> <pre><code>&lt;?php var_dump($_POST); ?&gt; &lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt; &lt;form method='POST'&gt; &lt;input type='text' name='nama' value='test'&gt; &lt;input type='submit' value='Submit'&gt; &lt;/form&gt; &lt;/body&gt;&lt;/html&gt; </code></pre> <p>And this code works perfectly fine on a single file i made on my server without CI.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload