Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49083

$http.post 404 page not found problem on chrome browser

$
0
0

@datafilik wrote:

Hello all,

I am trying to post data from a registration form to a mysql database using AngularJS together with PHP as the back-end scripting language. but when I click the button that triggers a submit() function I get a ionic.bundle.js:25000 POST 'php file url path' 404 (Not Found) error on chrome browser console.

Please I need help with resolving this as I am unable to access the php file that would have posted the collected data to a mysql database.

In the app.js file here is script for the post request:

app_ii = angular.module('regbdy', ['ionic']);

app_ii.controller('regCtrl', function($scope, $http) {
    $scope.submit = function(){
            var url = "php/reg_form.php";
            var fdata = {
                        headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'},
                        cache: false,
                        fname : $scope.fname,
                        lname : $scope.lname,
                        phone : $scope.phone,
                        email: $scope.email,
                        password : $scope.password,
                        ver_password: $scope.ver_password
                      };
            var request = $http.post(url, fdata);

            request.success(function (data) {
              console.log(data);
            });
        }
});

I am building the app using ionic on Cloud 9 IDE.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49083

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>