Welcome Guest, Not a member yet? Register   Sign In
$_POST not working without index.php
#1

[eluser]why.you.and.i[/eluser]
I have a simple login page and the URL structure is like 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://ellislab.com/forums/viewthread/191918/ which suggested to change my config.php from:

Code:
$config['uri_protocol'] = 'REQUEST_URI';

to

Code:
$config['uri_protocol'] = 'PATH_INFO';

And finally it worked but only when i add index.php on the URL like this: 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:

Code:
RewriteEngine on
RewriteCond $1 !^(index.php|assets|user_guide|robots.txt)
RewriteRule ^(.*)$ index.php/$1 [L]


Here is my controller (i reduced so it only loads the view, for debugging)

Code:
public function index()
{
$this->load->view('admin/login');
}

And my view has been reduced to this:

<?php var_dump($_POST); ?>
Code:
<html><head></head><body>      
<form method='POST'>
<input type='text' name='nama' value='test'>
<input type='submit' value='Submit'>
</form>
</body></html>


This code works perfectly fine on a single file i made on my server without CI, and even in my front page www.mydomain.com $_POST is working fine, it's only under www.mydomain.com/admin all $_POST is always empty.


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.
#2

[eluser]InsiteFX[/eluser]
Your not telling your form what action to take!
Code:
<form method="post" accept-charset="utf-8" action="http:/example.com/index.php/email/send" />




Theme © iAndrew 2016 - Forum software by © MyBB