Iam doing a post request to a php script form my AngularJS for mobile app. when iam using this code form action="url" method="post" in html.its working fine. but when iam using ajax url request in angularjs , php server is not receiving the values.Then how can i achieve that
mycode:
var data: { jwt: 's21@s.com' }
var req={
method : 'POST',
url: 'http:url//'
}
$http(req).success(function(data){
alert(JSON.stringify(data));
}).error(function(data) {
alert("failure");
alert(JSON.stringify(data));
});
}
myphp code:
$id = $_POST["jwt"];