PHP CURL Post Fields is not working : <p>PHP curl post is not working..</p>

<p>Here's my code </p>

<pre><code>   function post_to_url($url, $data) {
   $fields = '';
   foreach($data as $key =&gt; $value) { 
      $fields .= $key . '=' . $value . '&amp;'; 
   }
   rtrim($fields, '&amp;');

   $post = curl_init();

   curl_setopt($post, CURLOPT_URL, $url);
   curl_setopt($post, CURLOPT_POST, count($data));
   curl_setopt($post, CURLOPT_POSTFIELDS, $fields);
   curl_setopt($post, CURLOPT_RETURNTRANSFER, 1);

   $result = curl_exec($post);

   curl_close($post);
}

post_to_url("http://www.i-autosurf.com/signup.php",$data);
</code></pre>

<p>can you please checkout the error..</p>

<p>is the code going wrong or is there anything different in website.</p>
