1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Need Help + Proxy

Discussion in 'Other Languages' started by yafid, Jun 28, 2014.

  1. yafid

    yafid Newbie

    Joined:
    Mar 11, 2013
    Messages:
    5
    Likes Received:
    0
    hello , i need help to fix my script

    PHP:
    <?php
    $id 
    $_GET[id];
    $url=file_get_contents("........");
    $proxy =  '............';
    $proxyauth '.............';

    global 
    $proxy;
    $ch curl_init();
    curl_setopt($chCURLOPT_URL$url);
    curl_setopt($chCURLOPT_PROXY$proxy);
    curl_setopt($chCURLOPT_PROXYUSERPWD$proxyauth);
    curl_setopt($chCURLOPT_HEADER0); // return headers 0 no 1 yes
    curl_setopt($chCURLOPT_RETURNTRANSFERtrue); // return page 1:yes
    curl_setopt($chCURLOPT_TIMEOUT200); // http request timeout 20 seconds
    curl_setopt($chCURLOPT_FOLLOWLOCATIONtrue); // Follow redirects, need this if the url changes
    curl_setopt($chCURLOPT_MAXREDIRS6); //if http server gives redirection responce
    curl_setopt($chCURLOPT_USERAGENT,
        
    "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7");
    curl_setopt($chCURLOPT_COOKIEJAR"cookies.txt"); // cookies storage / here the changes have been made
    curl_setopt($chCURLOPT_COOKIEFILE"cookies.txt");
    curl_setopt($chCURLOPT_SSL_VERIFYPEERfalse); // false for https
    curl_setopt($chCURLOPT_ENCODING"gzip"); // the page encoding

    $data curl_exec($ch); // execute the http request
    curl_close($ch);

    $x=explode("amp;",$data);
    $t=array(); $g=array(); $h=array();
    echo 
    "<pre>\r\n";
    foreach(
    $x as $r){
        
    $c=explode("=",$r);
        
    $n=$c[0]; $v=$c[1];
        
    $y=urldecode($v);
        
    $t[$n]=$v;
    }

    print_r($t);
    echo 
    "\r\n</pre>";
    ?>
    if i run this script, i've got error:
    PHP:
    CacheHost%3A%20sppchi4.chicago.il.us%0D%0AErrPage%3A%20ERR_INVALID_URL%0D%0AErr%3A%20%5Bnone%5D%0D%0ATimeStamp%3A%20Thu,%2026%20Jun%202014%2020%3A23%3A48%20GMT%0D%0A%0D%0AClientIP%3A%20192.72.193.100%0D%0A%0D%0AHTTP%20Request%3A%0D%0A%0D%0A%0D%0A"
    anyone can help me to fix this script, i want run this script + proxy
     
  2. mypmmail

    mypmmail Junior Member

    Joined:
    Jan 31, 2008
    Messages:
    111
    Likes Received:
    27
    I think it's more like there is something wrong with the url you are trying to access instead of proxy problem.

    Maybe you should start with something really simple like www.wikipedia.org

    If this works, then it's likely to be your url which contains "special" characters like whitespace, &, etc which you need to encode
     
  3. k0d3r

    k0d3r Newbie

    Joined:
    Feb 17, 2013
    Messages:
    36
    Likes Received:
    28
    Location:
    Keyboard
    It's working here, I tested with the url http://google.com with a random HTTP proxy from a free proxy list.
    I think the problem is the URL you are using.
     
  4. yafid

    yafid Newbie

    Joined:
    Mar 11, 2013
    Messages:
    5
    Likes Received:
    0
    ok thank, its work now