2
I need to take 1 data passed from the angular controller to my php file, as I do?
app.controller("EditarPerfilCtrl", function ($scope, $http, $window) {
var idempresa = $window.localStorage.getItem('idemp');
var empresa = $window.localStorage.getItem('empresa');
var usuario = $window.localStorage.getItem('usuario');
var idusuario = $window.localStorage.getItem('idusuario');
$scope.empresa = empresa;
$scope.usuario = usuario;
var params = {
idusuario: idusuario
}
var buscaUsuario = function(){
$http.get("http://localhost:8888/sistemas/webApps/fluxo_de_caixa/fluxojoin_2.0/php/buscaUsuario.php", params).then(function(data){
console.log(data);
});
}
buscaUsuario();
});
php:
<?php
ini_set('display_errors', true);
error_reporting(E_ALL);
include_once("con.php");
$pdo = conectar();
$params = $_GET['params'];
print_r($params);
?>
which error?
– RFL
"<br /> <b>Notice</b>: Undefined index: params in <b>/Applications/MAMP/htdocs/systems/webApps/fluxo_de_box/fluxojoin_2.0/php/searchUsuario.php</b> on line <b>9</b><br />
– GustavoSevero
Already tried to give print_r($_GET) just to see what returns?
– André
I got it from the guy downstairs, but it’s a different problem now. This appears on the console: ""Uncaught Syntaxerror: Missing ) after argument list" and points to this line: $http.get("localhost:8888/systems/webApps/fluxo_de_box/Fl uxojoin_2.0/... ;, params: params). then(Function(date){"
– GustavoSevero