title: curl content of web page
body: <p>What is the problem with the following code?</p>
  
  <pre><code>&lt;?php
      function file_get_contents_curl($url) 
      {
          $ch = curl_init();
  
          curl_setopt($ch, CURLOPT_HEADER, 0);
          curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
          curl_setopt($ch, CURLOPT_URL, $url);
  
          $data = curl_exec($ch);
          curl_close($ch);
  
          return $data;
      }
  
      $var = file_get_contents_curl("http://www.sahibinden.com/131521670");
      var_dump($var);      
  
  ?&gt;
  </code></pre>
  
  <p>It just display bool(false) </p>
  
  <p>URL could be problem when put <a href="http://www.sahibinden.com/131521670" rel="nofollow">http://www.sahibinden.com/131521670</a> on browsers address bar, browser redirected to another page that I want its content.</p>
  
  <p>when I add following lines</p>
  
  <pre><code>curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  curl_setopt($ch, CURLOPT_VERBOSE, true);
  curl_setopt($ch, CURLOPT_STDERR, $fp );
  </code></pre>
  
  <p>output was</p>
  
  <pre><code>* About to connect() to www.sahibinden.com port 80 (#0)
  *   Trying 195.33.232.72... * connected
  * Connected to www.sahibinden.com (195.33.232.72) port 80 (#0)
  &gt; GET /131521670 HTTP/1.1
  
  Host: www.sahibinden.com
  
  Accept: */*
  
  * Closing connection #0
  * Failure when receiving data from the peer
  </code></pre>
  
  <p>CURLOPT_HEADER, 1);  also produce same result. </p>