I'm attempting to utilize Angular to send a login request. Due to the need for cross-domain communication, I am using JSONP. Below is the code:
$scope.data = {"device_id":"41b72a99efb9b713","buyer_phone":"245455588","buyer_password":"mkkslkj"};
console.log($scope.data);
$scope.data = JSON.stringify($scope.data);
console.log($scope.data);
$http({
method: 'jsonp',
url:'https://www.application.com/app/login.php',
data:$scope.data
}).success(function(data, status){
alert(data);
}) .error(function(data, status){
console.log('Request to the API Failed');
});
However, I am encountering errors
<br />
<b>Notice</b>: Trying to get property of non-object in
<b>/home/yarnlive/public_html/yarntest/app/buyerlogin.php</b> on line
<b>8</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in
<b>/home/yarnlive/public_html/yarntest/app/buyerlogin.php</b> on line
<b>9</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in
<b>/home/yarnlive/public_html/yarntest/app/buyerlogin.php</b> on line
<b>11</b><br />
{"status":"0","msg":"Invalid Username or Password","json_order":"2"}
Am I overlooking something? Please advise. Thank you.