Posting from web app to database fails
 
Post new topic   Reply to topic    Xorum Forum Index -> Request Proxies
View previous topic :: View next topic  
Author Message
hannabone3445Offline
Joined: 20 Sep 2021
Total posts: 6
Gender: Unknown
PostPosted: Mon Sep 20, 2021 5:48 pm    Post subject: Posting from web app to database fails Reply with quote
Using mysql database with PHP and AngularJs in Web App. The console is not throwing any errors. I used ng-model to double bind desc, pric, cat, and title to input tags in the html. Here is my javascript:

Code:
 app.controller('MainController', ['$scope', '$http', function($scope, $http) {

$scope.light = "Light";

var _userId = 44;
$scope.desc = "" ;
$scope.pric = "" ;
$scope.cat =  "";
$scope.title =  "HERE I AM!";


$scope.sendPost = function() {
    var data = $.param({
        json: JSON.stringify({
            userId: _userId,
            price: $scope.pric,
            description: $scope.desc,
            category: $scope.cat,
            postTitle: $scope.title,
            photo1: "",
            photo2: "",
            photo3: "",
            tag1: "",
            tag2: "",
            tag3: ""
        })
    });
    $http.post("http://speffs.one/SPE/post.php", data).success(function(data, status) {
        window.alert("HIII I AM IN");
    });
};


}]);


Everything is compiling/displaying nicely but it is not posting anything to the database when I do a retrieval from the database. The success alert "HI I AM IN" is also executing.

We've used PHP from an android platform with JSON and it has worked, it's just not working for our web app with angular. Help! Thank you! <3
Back to top
View user's profile 
billirexyOffline
Joined: 22 Sep 2021
Total posts: 2
Gender: Unknown
PostPosted: Wed Sep 22, 2021 12:33 pm    Post subject: best game Reply with quote
What is warhammer?
try this for best gaming experience
Back to top
View user's profile 
Display posts from previous:   
Post new topic   Reply to topic    Xorum Forum Index -> Request Proxies All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Powered by phpBB © 2001, 2002 phpBB Group