Вот основная логика функции:
Код: Выделить всё
$scope.executefunc = function(name,price){
var data = {
action: 'setcart',
bname: name,
bprice: price
}
$http.post('cart.php',data)
.then(function(response){
alert(response.data);
},function(err){
console.error("Error:",err);
});
};
});
Вот как выглядит файл php:< /p>
Код: Выделить всё
Подробнее здесь: [url]https://stackoverflow.com/questions/78710638/trying-to-pass-values-through-post-to-a-php-file-using-http-service-of-angular[/url]
Мобильная версия