10-19-2017, 03:35 PM
Hi guys,
i'm writing a backend in CI (frontend separated in html/js)
when i tried to send POST data to my controller $_POST is empty..
I've tried for few way but i always receive a empty array.
Maybe the problem could be about htaccess???
tried to call my API
two vars
id=test
email=[email protected]
tried already to set url with or without / at the end
my controller - Users.php -
in that case the result is
i'm sending request by Postman and my frontend. the result doesn't change.
here my - .htacces - (modified only for removing index.php)
i'm writing a backend in CI (frontend separated in html/js)
when i tried to send POST data to my controller $_POST is empty..
I've tried for few way but i always receive a empty array.
Maybe the problem could be about htaccess???
tried to call my API
Code:
http://mysite.com/users/register_post_user
id=test
email=[email protected]
tried already to set url with or without / at the end
my controller - Users.php -
PHP Code:
public function register_post_user()
{
print_r($_POST);
//few alternative i tried
//echo $_POST['id']." ".$_POST['email'];
//$id = $this->input->post('id');
//$email = $this->input->post('email');
//echo $id." ".$email;
}
Code:
Array ( )
i'm sending request by Postman and my frontend. the result doesn't change.
here my - .htacces - (modified only for removing index.php)
Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]