I am new with Anggularjs.I have a form and send ng model array to php file,i am getting error undefined index,don't know how to parse sent array from angularjs in php.
Part of html form
<div class="form-group" >
<label>Street<span class="error">*</span></label><span ng-show="!userForm.street.$pristine && userForm.street.$invalid || (userForm.street.$touched && !userForm.street)" class="error">Must be a number</span>
<input type="text" id="strret" class="form-control" name="userForm.street" ng-model="userForm.street" required ng-value="userForm.street" />
</div>
<div class="form-group" >
<label>Tel<span class="error">*</span></label><span ng-show="!userForm.tel.$pristine && userForm.tel.$invalid || (userForm.tel.$touched && !userForm.tel)" class="error">Must be number</span>
<input type="text" class="form-control" name="userForm.tel" ng-model="userForm.tel" required ng-pattern="/^[0]{1,13}$/" ng-value="userForm.tel"/>
</div>
Angularjs post function inside controller:
$http({
method :'POST',
url:'post.php',
data: $scope.userForm,
headers: {'Content-Type': 'application/x-www-form-urlencoded'}
})
.success(function(data){
alert(data);
}).error(function(err) {
alert(err);
});
My problem is how to take userForm.street and userForm.tel in PHP $_POST[]...There are similar questions on stackoverflow,but there is no any example of how to do this in php file.