I'm passing the values in angularjs using $http
to a url but I'm not able to get the values in AJAX file.
The following is my JS code:
$scope.insert = function() {
var name = $scope.name;
var pass = $scope.password;
alert(name);
alert(pass);
$http({
url : 'http://localhost/anguler/ajax.php?act=abc',
data : {"pass":pass,"name":name},
type : 'POST'
}).success (function(resp){
alert(resp);
});
}
And this is the code in ajax.php:
if(isset($_REQUEST['act']) == 'abc')
{
$user_name=$_POST['name'];
$password=$_POST['pass'];
echo $user_name.'**'.$password;
}
I'm not getting the values for $user_name
and $password
.