示例#1
0
文件: xsite.php 项目: Rudi9719/lucid
    $v = false;
    foreach ($_POST as $key => $value) {
        if ($key == "DESKTOP_XSITE_PARAMS" || $key == "dojo_preventCache") {
            continue;
        }
        if (!$v) {
            $v = true;
            $p->setMethod(HTTP_REQUEST_METHOD_POST);
        }
        $p->addPostData($key, $value);
    }
    foreach ($_GET as $key => $value) {
        if ($key == "DESKTOP_XSITE_PARAMS") {
            continue;
        }
        $p->addQueryString($key, $value);
    }
    $p->sendRequest();
    $type = $p->getResponseHeader("Content-Type");
    header("Content-Type: {$type}");
    foreach (array("400" => "Bad syntax", "401" => "Unauthorized", "402" => "Not Used (Payment Granted)", "403" => "Forbidden", "404" => "Not Found", "500" => "Internal Error", "501" => "Not Implemented", "502" => "Overloaded", "503" => "Gateway Timeout") as $key => $value) {
        if ($p->getResponseCode() == $key) {
            header("HTTP/1.0 " . $key . " " . $value);
        }
    }
    $body = $p->getResponseBody();
    echo $body;
    $p->disconnect();
} else {
    internal_error("permission_denied");
}