Файл: func.php
Строк: 39
<?php
/*
  $$___$__$$$$__$$$$$__$$__$$_$$______$$$$
  $$$_$$_$$__$$_$$__$$_$$__$$_$$_____$$__$$
  $$_$_$_$$__$$_$$$$$__$$__$$_$$_____$$$$$$
  $$___$_$$__$$_$$__$$_$$__$$_$$_____$$__$$
  $$___$__$$$$__$$$$$___$$$$__$$$$$$_$$__$$
 Mobula ICQ 610345 (http://imkat.ru || http://katwap.ru || http://c-click.ru)
Спасибо за покупку!
 */
function go($URL, $BRAUZER = 0, $IPLAM = '', $COOKIES = '', $POST = '', $PROXY = '', $HEADSERVER = 0, $TIMEOUT = 5, $FILE = 0) {
    if (!empty($URL)) {
        $REFER = trim(strtolower($URL));
        $REFER = str_replace('http://', '', $REFER);
        $REFER = explode('/', $REFER);
        $REFER = $REFER[0];
        if (!empty($REFER))
        $REFER = 'http://' . $REFER;
        $HOST = trim(strtolower($URL));
        $HOST = str_replace('http://', '', $HOST);
        $HOST = explode('/', $HOST);
        $HOST = $HOST[0];
        $HEAD = array();
        $HEAD[] = 'Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5';
        $HEAD[] = 'Connection: Keep-Alive';
        $HEAD[] = 'Accept-Charset: iso-8859-1, utf-8, utf-16, *;q=0.1';
        $HEAD[] = 'Accept-Language: ru-RU,ru;q=0.9,en;q=0.8';
        if (!empty($IPLAM))
            $HEAD[] = 'X-Forwarded-For: ' . $IPLAM;
        if ($BRAUZER == 2) {
            $HEAD[] = 'User-Agent: Opera/9.80 (Windows NT 6.0) Presto/2.12.388 Version/12.15';
            $UA = 'Opera/9.80 (Windows NT 6.0) Presto/2.12.388 Version/12.15';
        } elseif ($BRAUZER == 1) {
            $HEAD[] = 'User-Agent: Opera/9.80 (Series 60; Opera Mini/7.1.32444/29.3417; U; ru) Presto/2.8.119 Version/11.10';
            $UA = 'Opera/9.80 (Series 60; Opera Mini/7.1.32444/29.3417; U; ru) Presto/2.8.119 Version/11.10';
        } else {
            $HEAD[] = 'User-Agent: SonyEricssonC903/R1GA Browser/NetFront/3.4 Profile/MIDP-2.1 Configuration/CLDC-1.1 JavaPlatform/JP-8.4.4';
            $UA = 'SonyEricssonC903/R1GA Browser/NetFront/3.4 Profile/MIDP-2.1 Configuration/CLDC-1.1 JavaPlatform/JP-8.4.4';
        }
        if (!empty($REFER))
            $HEAD[] = 'Referer: ' . $REFER;
        if (!empty($HOST))
            $HEAD[] = 'Host: ' . $HOST;
        $CURL = curl_init();
        if (!empty($PROXY))
        curl_setopt($CURL, CURLOPT_PROXY, $PROXY);
        curl_setopt($CURL, CURLOPT_URL, $URL);
        curl_setopt($CURL, CURLOPT_HTTPHEADER, $HEAD);
        if (!empty($COOKIES))
            curl_setopt($CURL, CURLOPT_COOKIE, $COOKIES);
        if (!empty($POST)) {
            curl_setopt($CURL, CURLOPT_POST, 1);
            curl_setopt($CURL, CURLOPT_POSTFIELDS, $POST);
        }
        curl_setopt($CURL, CURLOPT_AUTOREFERER, false);
        curl_setopt($CURL, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($CURL, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($CURL, CURLOPT_SSL_VERIFYHOST, false);
        curl_setopt($CURL, CURLOPT_FOLLOWLOCATION, false);
        if ($HEADSERVER == 0)
            curl_setopt($CURL, CURLOPT_HEADER, false);
        else
            curl_setopt($CURL, CURLOPT_HEADER, true);
        if ($FILE == 1) {
            $fp = fopen('img.gif', 'w+b');
            curl_setopt($CURL, CURLOPT_FILE, $fp);
        }
        curl_setopt($CURL, CURLOPT_TIMEOUT, $TIMEOUT);
        $get = curl_exec($CURL);
        curl_close($CURL);
        if ($FILE == 1)
            fclose($fp);
    }else
        $get = 'WRONG URL FORM!';
    return $get;
}
function getcookie($URLOUT) {
    preg_match_all('/Set-Cookie:(.*);/ixU', $URLOUT, $COOKIE);
    $c = '';
    for ($i = 0, $s = sizeof($COOKIE[1]); $i < $s; ++$i) {
        $c .= trim($COOKIE[1][$i]) . ';';
    }
    return $c;
}
?>