Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all articles
Browse latest Browse all 14343

input post empty

$
0
0
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 
Code:
http://mysite.com/users/register_post_user
two vars
id=test
email=test@test.test
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;
    

in that case the result is
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]

Viewing all articles
Browse latest Browse all 14343

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>