if (is_array($data)) { header("HTTP/1.1 200 OK"); header("Content-Type: text/html"); echo json_encode($data); exit; } } } else { if (strcmp($request['cmd'], 'loadExportSettings') == 0) { if (!$userdata->userExists($request['username'])) { header("HTTP/1.1 403 Forbidden"); header("Content-Type: text/html"); print "User does not exist\r\n"; exit; } else { $data = $userdata->loadExportSettings($request['username']); if (is_array($data)) { header("HTTP/1.1 200 OK"); header("Content-Type: text/html"); echo json_encode($data); exit; } } } } } } header("HTTP/1.1 404 Not Found"); header("Content-Type: text/html"); print "unknown command\r\n"; exit;