setFetchMode( MDB2_FETCHMODE_ASSOC ); $operation = $_REQUEST["operation"]; $target = $_REQUEST["target"]; $options = json_decode( $_REQUEST["options"] ); $response = null; if ( $operation == "add" ) { if ( $target == "show" ) { $response = '{ "code": 0, "response": { "id": 1, "name": "' . $options->name . '" } }'; } else { $response = helga_error( "add::show: unknown target ' . $target . '." ); } } else if ( $operation == "get" ) { require( "get.php" ); } else if ( $operation == "typeof" ) { require( "typeof.php" ); } else { $response = helga_error( "Unknown operation ' . $operation . '." ); } echo $response; ?>