I sending some form data using:
.controller('signupController',function($scope,$http){
$scope.submitSignup = function(){
var firstLast = $scope.firstLast;
var email = $scope.email;
var phone = $scope.phone;
var zip = $scope.zip;
var signup = $scope.signup;
$http({
method: 'POST',
url: '../process.php',
headers: {
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
},
data: {
firstLast:firstLast,
email:email,
phone:phone,
zip:zip
}
})
.then(function(res){
console.log(res);
});
}
})
If I return my query I get:
data: "INSERT INTO signups (signup_name,email,phone,zip) VALUES ('','','','')"
As you can see my values are empty. However, if I return a $_POST
values I get that it's null and I can get a message that my values are undefined if I turn on php errors.
I've set the header content-type and they usually avoids this issue.