I have a function inside an AngularJS controller that let me send POST data to a PHP page (it should be for authentication)
$scope.submit = function () {
$http.post(api + 'login.php', $scope.user)
};
This function is called from this HTML code
<div>
<span ng-show="isAuthenticated">{{welcome}}</span>
<form ng-show="!isAuthenticated" ng-submit="submit()">
<input ng-model="user.username" type="text" name="user" placeholder="Username" />
<input ng-model="user.password" type="password" name="pass" placeholder="Password" />
<input type="submit" value="Login" />
</form>
<div>{{error}}</div>
<div ng-show="isAuthenticated">
<a ng-click="logout()" href="">Logout</a>
</div>
</div>
Using Firebug inside Firefox I can see that auth page is called and POST data is sent correctly

Problem raises within my auth PHP code: I try to retrieve POST data, but array is empty.
I've also tried to write content in a file and I can confirm array is empty (file contains [])
$userdata = $_POST;
file_put_contents("login.txt",json_encode($userdata)."\n", FILE_APPEND);
What's wrong with my code?
I've also tried changing from POST to GET (using $http.get), but $_GET array is empty too...
var_dump($_POST)?var_dump(file_get_contents("php://input"))?var_dump(http_get_request_body()?