Very new with AngularJS, I'm sure it's something simple I'm doing wrong but I cannot figure it out. All I'm trying to do is log the incoming POST from Angular, using PHP.
AngularJS function:
$scope.addTask = function() {
$http.post('process.php', { newTask: $scope.newTask });
$scope.newTask = '';
};
process.php:
if (isset($_POST['newTask'])) {
createLog('test');
}
function createLog ($str) {
$file = 'log.txt';
$str .= "
";
file_put_contents($file, $str, FILE_APPEND | LOCK_EX);
}