title: Cant get the html dom by php curl.
body: <p>I have used php CURL to get the html or echo the html. But it is suddenky redirecting, when i am trying with this code.</p>
  
  <pre><code>    $cookie = tempnam ("/tmp", "CURLCOOKIE");  
      $ch = curl_init(); 
  
    function get_data( $ch, $url, $post, $cookie ){
      $agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7"; 
      curl_setopt($ch, CURLOPT_URL, $url);
      curl_setopt($ch, CURLOPT_USERAGENT, $agent);
      //curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie); 
      curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie); 
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0); 
      curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0); 
      curl_setopt($ch, CURLOPT_HEADER, 0); 
      curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1); 
      curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
      if( $post != '' ) 
        curl_setopt($ch, CURLOPT_POSTFIELDS, $post); 
      return curl_exec($ch); 
    }
    $url = 'https://iapps.courts.state.ny.us/webcivil/FCASSearch?param=I';
    $html = get_data( $ch, $url, '', '' );
    echo $html; exit;
  </code></pre>
  
  <p>I have played with these </p>
  
  <pre><code>CURLOPT_RETURNTRANSFER,
  CURLOPT_FOLLOWLOCATION,
  CURLOPT_COOKIEJAR,
  CURLOPT_COOKIEFILE
  </code></pre>
  
  <p>But still i got redirection when trying to get the html. How can i get the  HTML of the page or is there any other thing try ?</p>