title: How do I reset Curl variables in PHP?
body: <p>I want to do a number of Curl calls in a row, the first one is a post, but for the second one I just want to load a page and not post anything to do.</p>
  
  <p>Here is my code, which does not work</p>
  
  <pre><code>$url = 'http://www.xxxx.com/results.php';
  $curl_handle=curl_init();
  curl_setopt ($curl_handle, CURLOPT_PROXY, $tor);
  curl_setopt( $curl_handle, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
  curl_setopt($curl_handle, CURLOPT_REFERER, $referer);
  
  curl_setopt($curl_handle, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"); 
  $data = 'Manufacturer=1265';
  curl_setopt($curl_handle, CURLOPT_POST,1);
  curl_setopt($curl_handle, CURLOPT_POSTFIELDS ,$data);
  curl_setopt($curl_handle,CURLOPT_URL,$url);
  curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,2);
  curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1);
  $buffer = curl_exec($curl_handle);
  
  $dest = 'http://www.xxxx.com/search.php';
  curl_setopt($curl_handle, CURLOPT_GET, 1);
  curl_setopt($curl_handle, CURLOPT_URL, $dest);
  $result = curl_exec ($curl_handle);
  curl_close ($curl_handle); 
  echo $result;
  </code></pre>
  
  <p>When I close the curl handle and open a new one for the second request it works fine. I do not think this is best practice though?</p>