'success', 'msg' => 'logged in']); } else { // Authentication failed echo json_encode(['status' => 'failure', 'msg' => $data["msg"]]); } } else { // Invalid response format or missing status echo json_encode(['status' => 'failure', 'msg' => 'Invalid response from authentication server']); } ?>