Im Using ionic framework. And I have written a code to send the form data of an ionic application with angularjs to mysql. My code works fine, but only empty records are inserted to mysql These are the codes:
form.html
<div class="list">
<form>
<div><input type="text" ng-model="h" ></div>
<div><input type="text" ng-model="s"></div>
<button ng-click='SignUp();'>SignUp</button>
</form>
</div>
Controller
.controller('SearchCntrl', function($scope, $http) {
$scope.SignUp = function() {
$http.post('http://www.qatarperfectmedia.com/channel/postdata.php',
{'h':$scope.h, 's':$scope.s}
).success(function(data, status, headers, config) {
if (data.msg != '')
{
$scope.msgs.push(data.msg);
}
else
{
$scope.errors.push(data.error);
}
}).error(function(data, status) {
$scope.errors.push(status);
});
}
})
The problem i face is when form submitted, only empty records are being inserted to database. Thnk you