Category : php

I have application in Angular 11 and api in Laravel 8. From Angular I send request to api in Laravel: signup(data) { const headerDict = { // ‘Content-Type’: ‘application/json’, // ‘Accept’: ‘application/json’, ‘Access-Control-Allow-Headers’: ‘*’, ‘Access-Control-Allow-Origin’: ‘*’, ‘Access-Control-Allow-Methods’: ‘*’, ‘Access-Control-Allow-Credentials’: ‘true’ } const requestOptions = { headers: new HttpHeaders(headerDict), }; // return this.http.post(AppConfig.signupUrl, data); //deosn’t work ..

Read more

I’m trying to make a simple app where I add people’s first and last names into a database. But when I try to add an entry, I get [object Object] error. My controller looks like this: myApp.controller(‘userController’, [‘$scope’, ‘$http’, function($scope, $http){ $scope.insertData = function(){ $http.post( "insert.php", {‘firstname’:$scope.firstname, ‘lastname’:$scope.lastname} ).then(function(response){ alert(data); $scope.firstname = null; $scope.lastname = ..

Read more