Example #1
0
            $msg = L("No ops processor!");
        }
    } catch (PDOException $e) {
        if ($e->errorInfo[1] == 1062) {
            $msg = L("Duplicated record when doing ops, please check the parameters!");
        } else {
            $msg = L("Failed to execute query: ") . (IN_DEBUG ? $e->query_string : $e->getMessage());
        }
    } catch (Exception $e) {
        $msg = L("Exception happens: ") . $e->getMessage();
    }
    if ($ret !== true && $ctx) {
        $ctx->rollback();
    }
}
set_content_type(QWP_TP_JSON);
$msg_type = "error";
$ret = false;
$msg = "";
$data = array();
do {
    global $F;
    if (!isset($F)) {
        break;
    }
    if (qwp_ops_pre_check($msg) === false) {
        break;
    }
    $msg = qwp_validate_form();
    if ($msg !== true) {
        break;
Example #2
0
function qwp_create_text_response($text)
{
    set_content_type(QWP_TP_TEXT_PLAIN);
    echo $text;
}