title: How to get data using cURL through Proxy connection
body: <p>I would like to open any url with help of cURL using proxy connection. Below are the codes... still we are not able to connect this and getting positive data through this function Please provide the suitable help to resolve this issue. Every time i run this code. I got the "Else" conditioned message. </p>
  
  <pre><code>&lt;?php
  function getPage($proxy, $url, $referer, $agent, $header, $timeout) {
      $ch = curl_init();
      curl_setopt($ch, CURLOPT_URL, $url);
      curl_setopt($ch, CURLOPT_HEADER, $header);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
      curl_setopt($ch, CURLOPT_PROXY, $proxy);
      curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
      curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
      curl_setopt($ch, CURLOPT_REFERER, $referer);
      curl_setopt($ch, CURLOPT_USERAGENT, $agent);
  
      $result['EXE'] = curl_exec($ch);
      $result['INF'] = curl_getinfo($ch);
      $result['ERR'] = curl_error($ch);
  
      curl_close($ch);
  
      return $result;
  }
  ?&gt;
  &lt;?php
  $result = getPage(
      '[64.71.138.122]:[80]', // use valid proxy
      'http://www.google.com/search?q=twitter',
      'http://www.google.com/',
      'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1',
      1,
      5);
  
  if (empty($result['ERR'])) {
      echo "Positive message" ;
  } else {
      echo "Negative Message" ;
  }
  ?&gt;
  </code></pre>
  
  <p>When we print this "print_r($result);" the result would be ..........</p>
  
  <pre><code>        Array ( [EXE] =&gt; [INF] =&gt; Array ( [url] =&gt; http://www.google.com/search?q=twitter [content_type] =&gt; [http_code] =&gt; 0 [header_size] =&gt; 0 [request_size] =&gt; 0 [filetime] =&gt; -1 [ssl_verify_result] =&gt; 0 [redirect_count] =&gt; 0 [total_time] =&gt; 5.019769 [namelookup_time] =&gt; 0.000129 [connect_time] =&gt; 0 [pretransfer_time] =&gt; 0 [size_upload] =&gt; 0 [size_download] =&gt; 0 [speed_download] =&gt; 0 [speed_upload] =&gt; 0 [download_content_length] =&gt; -1 [upload_content_length] =&gt; -1 [starttransfer_time] =&gt; 0 [redirect_time] =&gt; 0 ) [ERR] =&gt; connect() timed out! ) 
  </code></pre>