Пример #1
0
    $postdata .= '&' . urlencode($k) . '=' . urlencode($v);
}
// This GET value will over write anything set before
if (!empty($_GET['token'])) {
    $postdata .= '&token=' . $_GET['token'];
} else {
    if (!empty($_POST['token'])) {
        $postdata .= '&token=' . $_POST['token'];
    } else {
        if (!empty($_COOKIE['ShareUT'])) {
            $postdata .= '&token=' . $_COOKIE['ShareUT'];
        }
    }
}
if (!empty($_COOKIE['__stid'])) {
    $postdata .= '&clicookie=' . $_COOKIE['__stid'];
}
$ipAddress = !empty($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
if (!empty($ipAddress)) {
    $postdata .= '&ipaddress=' . $ipAddress;
}
if (!empty($postdata)) {
    list($output, $info) = AjaxProxy::makePostRequest($url, $postdata);
    //	header("Content-Type: ".$info["content_type"]);
    header("Content-Type: text/html");
    echo $output;
} else {
    header("Content-Type: text/xml");
    echo '<?xml version="1.0" encoding="UTF-8"?>';
    echo '<response status="POST_FAILED" statusMessage="Missing stuff." />';
}