<?
header('Content-Type: text/xml; charset=utf-8');
set_time_limit(120);

if(!empty($_REQUEST["url"])) {
    if(!empty($_REQUEST["login"]) && !empty($_REQUEST["password"])) {
        list($p, $url) = explode("://", $_REQUEST["url"]);
        $url = "https://".$_REQUEST["login"].":".$_REQUEST["password"]."@".$url;
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_POST,1);
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,  2);
        curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7");
        curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
        $content = curl_exec ($ch);
        curl_close ($ch);
        echo $content;

    } else {
        if (!($fp = @fopen($_REQUEST["url"], "r"))) {
            exit;
        }
        while ($data = fread($fp, 4096)) {
            echo $data;
        }
    }
}
?>