1
I have the following code:
case 'operator-autentication':
global $decoded;
$array = array();
$user = $decoded->user;
$pass = $decoded->pass;
$opr = new opr_func();
$arrResp = $opr->loginFunc($user, $pass);
if(empty($arrResp) == true) {
$array[] = array('id' => '0');
} else {
foreach($opr->loginOperator($decoded->code, $decoded->pass) as $ip) {
$array[] = array('id' => $ip->id, 'name' => $ip->name, 'clientId' => $ip->clientId);
}
}
echo json_encode($array);
break;
When I test a send of parameters it happens the error:
↵Notice: Undefined Property: stdClass::$user in /Applications/XAMPP/xamppfiles/htdocs/bullGreenPanel/Assets/php/client/Appcollect.php online 94
If you don’t use the var $decoded->code
(which is what comes in the app) works, what would be reason and solution ?
Ps: at the beginning of the code has :
$postdata = file_get_contents("php://input");
$decoded = json_decode($postdata);
After global $decoded put a print_r of this variable. See the contents of it and post so we can understand what it contains.
– Bruno Rigolon
Apparently
$decoded
does not have the attributeuser
.– Woss
Really, my fault, does not have the attribute user... pfvr put an answer to give as ok
– Augusto Furlan