I am trying to make part of my script send some data to another page. It doesn't seem to be working correctly. It connects to the URL it is suppose to, but it doesn't post the fields.

My code:
PHP Code:
                $postvars='';
                
$sep='';
                foreach(
$fields as $key=>$value
                { 
                   
$postvars.= $sep.urlencode($key).'='.urlencode($value); 
                   
$sep='&'
                }

                
$ch curl_init();
                
curl_setopt($ch,CURLOPT_URL$row['site_postback']);
                
curl_setopt($ch,CURLOPT_POST,count($fields));
                
curl_setopt($ch,CURLOPT_POSTFIELDS,$postvars);
                
$result curl_exec($ch);
                
curl_close($ch); 
Any idea's how to post the fields?